rust/tests/ui/let_return.stderr
Andy Russell effea41fe4
tweak let_and_return diagnostic
Label the unnecessary let binding and convert the note to structured
suggestion.
2019-05-24 14:52:55 -04:00

31 lines
630 B
Plaintext

error: returning the result of a let binding from a block
--> $DIR/let_return.rs:7:5
|
LL | let x = 5;
| ---------- unnecessary let binding
LL | x
| ^
|
= note: `-D clippy::let-and-return` implied by `-D warnings`
help: return the expression directly
|
LL |
LL | 5
|
error: returning the result of a let binding from a block
--> $DIR/let_return.rs:13:9
|
LL | let x = 5;
| ---------- unnecessary let binding
LL | x
| ^
help: return the expression directly
|
LL |
LL | 5
|
error: aborting due to 2 previous errors