rust/tests/ui/needless_late_init_fixable.stderr
2022-05-03 17:51:34 +08:00

71 lines
1.4 KiB
Plaintext

error: unneeded late initialization
--> $DIR/needless_late_init_fixable.rs:6:5
|
LL | let a;
| ^^^^^^ created here
LL | a = "zero";
| ^^^^^^^^^^ initialised here
|
= note: `-D clippy::needless-late-init` implied by `-D warnings`
help: declare `a` here
|
LL | let a = "zero";
| ~~~~~
error: unneeded late initialization
--> $DIR/needless_late_init_fixable.rs:9:5
|
LL | let b;
| ^^^^^^ created here
LL | let c;
LL | b = 1;
| ^^^^^ initialised here
|
help: declare `b` here
|
LL | let b = 1;
| ~~~~~
error: unneeded late initialization
--> $DIR/needless_late_init_fixable.rs:10:5
|
LL | let c;
| ^^^^^^ created here
LL | b = 1;
LL | c = 2;
| ^^^^^ initialised here
|
help: declare `c` here
|
LL | let c = 2;
| ~~~~~
error: unneeded late initialization
--> $DIR/needless_late_init_fixable.rs:14:5
|
LL | let d: usize;
| ^^^^^^^^^^^^^ created here
LL | d = 1;
| ^^^^^ initialised here
|
help: declare `d` here
|
LL | let d: usize = 1;
| ~~~~~~~~~~~~
error: unneeded late initialization
--> $DIR/needless_late_init_fixable.rs:17:5
|
LL | let e;
| ^^^^^^ created here
LL | e = format!("{}", d);
| ^^^^^^^^^^^^^^^^^^^^ initialised here
|
help: declare `e` here
|
LL | let e = format!("{}", d);
| ~~~~~
error: aborting due to 5 previous errors