rust/tests/ui/let_return.stderr

32 lines
973 B
Text
Raw Normal View History

error: returning the result of a let binding from a block. Consider returning the expression directly.
--> $DIR/let_return.rs:10:5
|
10 | x //~ERROR returning the result of a let binding
| ^
|
note: lint level defined here
--> $DIR/let_return.rs:5:9
|
5 | #![deny(let_and_return)]
| ^^^^^^^^^^^^^^
note: this expression can be directly returned
--> $DIR/let_return.rs:9:13
|
9 | let x = 5; //~NOTE this expression can be directly returned
| ^
error: returning the result of a let binding from a block. Consider returning the expression directly.
--> $DIR/let_return.rs:16:9
|
16 | x //~ERROR returning the result of a let binding
| ^
|
note: this expression can be directly returned
--> $DIR/let_return.rs:15:17
|
15 | let x = 5; //~NOTE this expression can be directly returned
| ^
error: aborting due to 2 previous errors