-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #4137 - euclio:let-return, r=oli-obk
tweak `let_and_return` diagnostic changelog: `let_and_return`: label the unnecessary let binding and convert the note to a structured suggestion
- Loading branch information
Showing
3 changed files
with
43 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
error: returning the result of a let binding from a block. Consider returning the expression directly. | ||
error: returning the result of a let binding from a block | ||
--> $DIR/matches.rs:9:13 | ||
| | ||
LL | let x = 3; | ||
| ---------- unnecessary let binding | ||
LL | x | ||
| ^ | ||
| | ||
= note: `-D clippy::let-and-return` implied by `-D warnings` | ||
note: this expression can be directly returned | ||
--> $DIR/matches.rs:8:21 | ||
help: return the expression directly | ||
| | ||
LL | | ||
LL | 3 | ||
| | ||
LL | let x = 3; | ||
| ^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
error: returning the result of a let binding from a block. Consider returning the expression directly. | ||
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` | ||
note: this expression can be directly returned | ||
--> $DIR/let_return.rs:6:13 | ||
help: return the expression directly | ||
| | ||
LL | | ||
LL | 5 | ||
| | ||
LL | let x = 5; | ||
| ^ | ||
|
||
error: returning the result of a let binding from a block. Consider returning the expression directly. | ||
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 | ||
| | ||
note: this expression can be directly returned | ||
--> $DIR/let_return.rs:12:17 | ||
LL | | ||
LL | 5 | ||
| | ||
LL | let x = 5; | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
|