2018-08-08 12:28:26 +00:00
|
|
|
error: unused variable: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:8:7
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | fn f1(x: isize) {
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2020-01-22 23:57:38 +00:00
|
|
|
note: the lint level is defined here
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:2:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | #![deny(unused_variables)]
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: unused variable: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:12:8
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | fn f1b(x: &mut isize) {
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: unused variable: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:20:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let x: isize;
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: unused variable: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:25:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let x = 3;
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: variable `x` is assigned to, but never used
|
2021-02-28 20:03:36 +00:00
|
|
|
--> $DIR/liveness-unused.rs:30:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let mut x = 3;
|
2021-02-28 20:03:36 +00:00
|
|
|
| ^
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
= note: consider using `_x` instead
|
|
|
|
|
|
|
|
error: value assigned to `x` is never read
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:32:5
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | x += 4;
|
|
|
|
| ^
|
|
|
|
|
|
2022-09-18 15:55:36 +00:00
|
|
|
= help: maybe it is overwritten before being read?
|
2020-01-22 23:57:38 +00:00
|
|
|
note: the lint level is defined here
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:3:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | #![deny(unused_assignments)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: variable `z` is assigned to, but never used
|
2021-02-28 20:03:36 +00:00
|
|
|
--> $DIR/liveness-unused.rs:37:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let mut z = 3;
|
2021-02-28 20:03:36 +00:00
|
|
|
| ^
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
= note: consider using `_z` instead
|
|
|
|
|
|
|
|
error: unused variable: `i`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:59:12
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | Some(i) => {
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: unused variable: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:79:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | for x in 1..10 { }
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: unused variable: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:84:10
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | for (x, _) in [1, 2, 3].iter().enumerate() { }
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
2024-03-07 14:23:52 +00:00
|
|
|
warning: unreachable statement
|
|
|
|
--> $DIR/liveness-unused.rs:92:9
|
|
|
|
|
|
|
|
|
LL | continue;
|
|
|
|
| -------- any code following this expression is unreachable
|
|
|
|
LL | drop(*x as i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^ unreachable statement
|
|
|
|
|
|
|
|
|
note: the lint level is defined here
|
|
|
|
--> $DIR/liveness-unused.rs:1:9
|
|
|
|
|
|
|
|
|
LL | #![warn(unused)]
|
|
|
|
| ^^^^^^
|
|
|
|
= note: `#[warn(unreachable_code)]` implied by `#[warn(unused)]`
|
|
|
|
|
2018-08-08 12:28:26 +00:00
|
|
|
error: unused variable: `x`
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:89:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | for (_, x) in [1, 2, 3].iter().enumerate() {
|
2020-03-23 08:02:46 +00:00
|
|
|
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: variable `x` is assigned to, but never used
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:112:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | let x;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
= note: consider using `_x` instead
|
|
|
|
|
|
|
|
error: value assigned to `x` is never read
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/liveness-unused.rs:116:9
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | x = 0;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^
|
2018-12-07 14:15:36 +00:00
|
|
|
|
|
|
|
|
= help: maybe it is overwritten before being read?
|
2018-08-08 12:28:26 +00:00
|
|
|
|
2020-03-11 15:30:09 +00:00
|
|
|
error: aborting due to 13 previous errors; 1 warning emitted
|
2018-08-08 12:28:26 +00:00
|
|
|
|