2022-04-15 14:00:44 -05:00
|
|
|
error: unneeded late initialization
|
2021-11-18 07:54:49 -06:00
|
|
|
--> $DIR/needless_late_init_fixable.rs:6:5
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let a;
|
2022-05-03 04:51:34 -05:00
|
|
|
| ^^^^^^ created here
|
|
|
|
LL | a = "zero";
|
|
|
|
| ^^^^^^^^^^ initialised here
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-late-init` implied by `-D warnings`
|
|
|
|
help: declare `a` here
|
|
|
|
|
|
|
|
|
LL | let a = "zero";
|
|
|
|
| ~~~~~
|
|
|
|
|
2022-04-15 14:00:44 -05:00
|
|
|
error: unneeded late initialization
|
2021-11-18 07:54:49 -06:00
|
|
|
--> $DIR/needless_late_init_fixable.rs:9:5
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let b;
|
2022-05-03 04:51:34 -05:00
|
|
|
| ^^^^^^ created here
|
|
|
|
LL | let c;
|
|
|
|
LL | b = 1;
|
|
|
|
| ^^^^^ initialised here
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
help: declare `b` here
|
|
|
|
|
|
|
|
|
LL | let b = 1;
|
|
|
|
| ~~~~~
|
|
|
|
|
2022-04-15 14:00:44 -05:00
|
|
|
error: unneeded late initialization
|
2021-11-18 07:54:49 -06:00
|
|
|
--> $DIR/needless_late_init_fixable.rs:10:5
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let c;
|
2022-05-03 04:51:34 -05:00
|
|
|
| ^^^^^^ created here
|
|
|
|
LL | b = 1;
|
|
|
|
LL | c = 2;
|
|
|
|
| ^^^^^ initialised here
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
help: declare `c` here
|
|
|
|
|
|
|
|
|
LL | let c = 2;
|
|
|
|
| ~~~~~
|
|
|
|
|
2022-04-15 14:00:44 -05:00
|
|
|
error: unneeded late initialization
|
2021-11-18 07:54:49 -06:00
|
|
|
--> $DIR/needless_late_init_fixable.rs:14:5
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | let d: usize;
|
2022-05-03 04:51:34 -05:00
|
|
|
| ^^^^^^^^^^^^^ created here
|
|
|
|
LL | d = 1;
|
|
|
|
| ^^^^^ initialised here
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
help: declare `d` here
|
|
|
|
|
|
|
|
|
LL | let d: usize = 1;
|
|
|
|
| ~~~~~~~~~~~~
|
|
|
|
|
2022-04-15 14:00:44 -05:00
|
|
|
error: unneeded late initialization
|
2021-11-18 07:54:49 -06:00
|
|
|
--> $DIR/needless_late_init_fixable.rs:17:5
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
2022-04-01 12:23:47 -05:00
|
|
|
LL | let e;
|
2022-05-03 04:51:34 -05:00
|
|
|
| ^^^^^^ created here
|
|
|
|
LL | e = format!("{}", d);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ initialised here
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
2022-04-01 12:23:47 -05:00
|
|
|
help: declare `e` here
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
2022-04-01 12:23:47 -05:00
|
|
|
LL | let e = format!("{}", d);
|
2021-12-06 05:33:31 -06:00
|
|
|
| ~~~~~
|
|
|
|
|
2022-04-01 12:23:47 -05:00
|
|
|
error: aborting due to 5 previous errors
|
2021-12-06 05:33:31 -06:00
|
|
|
|