mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
cc622608db
`must_use_unit` lints unit-returning functions with a `#[must_use]` attribute, suggesting to remove it. `double_must_use` lints functions with a plain `#[must_use]` attribute, but which return a type which is already `#[must_use]`, so the attribute has no benefit. `must_use_candidate` is a pedantic lint that lints functions and methods that return some non-unit type that is not already `#[must_use]` and suggests to add the annotation.
138 lines
2.8 KiB
Text
138 lines
2.8 KiB
Text
error: `x` is shadowed by itself in `&mut x`
|
|
--> $DIR/shadow.rs:26:5
|
|
|
|
|
LL | let x = &mut x;
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:25:13
|
|
|
|
|
LL | let mut x = 1;
|
|
| ^
|
|
|
|
error: `x` is shadowed by itself in `{ x }`
|
|
--> $DIR/shadow.rs:27:5
|
|
|
|
|
LL | let x = { x };
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:26:9
|
|
|
|
|
LL | let x = &mut x;
|
|
| ^
|
|
|
|
error: `x` is shadowed by itself in `(&*x)`
|
|
--> $DIR/shadow.rs:28:5
|
|
|
|
|
LL | let x = (&*x);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:27:9
|
|
|
|
|
LL | let x = { x };
|
|
| ^
|
|
|
|
error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
|
|
--> $DIR/shadow.rs:29:9
|
|
|
|
|
LL | let x = { *x + 1 };
|
|
| ^
|
|
|
|
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
|
|
note: initialization happens here
|
|
--> $DIR/shadow.rs:29:13
|
|
|
|
|
LL | let x = { *x + 1 };
|
|
| ^^^^^^^^^^
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:28:9
|
|
|
|
|
LL | let x = (&*x);
|
|
| ^
|
|
|
|
error: `x` is shadowed by `id(x)` which reuses the original value
|
|
--> $DIR/shadow.rs:30:9
|
|
|
|
|
LL | let x = id(x);
|
|
| ^
|
|
|
|
|
note: initialization happens here
|
|
--> $DIR/shadow.rs:30:13
|
|
|
|
|
LL | let x = id(x);
|
|
| ^^^^^
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:29:9
|
|
|
|
|
LL | let x = { *x + 1 };
|
|
| ^
|
|
|
|
error: `x` is shadowed by `(1, x)` which reuses the original value
|
|
--> $DIR/shadow.rs:31:9
|
|
|
|
|
LL | let x = (1, x);
|
|
| ^
|
|
|
|
|
note: initialization happens here
|
|
--> $DIR/shadow.rs:31:13
|
|
|
|
|
LL | let x = (1, x);
|
|
| ^^^^^^
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:30:9
|
|
|
|
|
LL | let x = id(x);
|
|
| ^
|
|
|
|
error: `x` is shadowed by `first(x)` which reuses the original value
|
|
--> $DIR/shadow.rs:32:9
|
|
|
|
|
LL | let x = first(x);
|
|
| ^
|
|
|
|
|
note: initialization happens here
|
|
--> $DIR/shadow.rs:32:13
|
|
|
|
|
LL | let x = first(x);
|
|
| ^^^^^^^^
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:31:9
|
|
|
|
|
LL | let x = (1, x);
|
|
| ^
|
|
|
|
error: `x` is shadowed by `y`
|
|
--> $DIR/shadow.rs:34:9
|
|
|
|
|
LL | let x = y;
|
|
| ^
|
|
|
|
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
|
|
note: initialization happens here
|
|
--> $DIR/shadow.rs:34:13
|
|
|
|
|
LL | let x = y;
|
|
| ^
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:32:9
|
|
|
|
|
LL | let x = first(x);
|
|
| ^
|
|
|
|
error: `x` shadows a previous declaration
|
|
--> $DIR/shadow.rs:36:5
|
|
|
|
|
LL | let x;
|
|
| ^^^^^^
|
|
|
|
|
note: previous binding is here
|
|
--> $DIR/shadow.rs:34:9
|
|
|
|
|
LL | let x = y;
|
|
| ^
|
|
|
|
error: aborting due to 9 previous errors
|
|
|