-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #64669 - estebank:unreachable, r=Centril
Use span label instead of note in unreachable lint Fix #64636.
- Loading branch information
Showing
35 changed files
with
191 additions
and
334 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
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
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,19 +1,16 @@ | ||
error: unreachable statement | ||
--> $DIR/issue-7246.rs:7:5 | ||
| | ||
LL | return; | ||
| ------ any code following this expression is unreachable | ||
LL | if *ptr::null() {}; | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^^^^ unreachable statement | ||
| | ||
note: lint level defined here | ||
--> $DIR/issue-7246.rs:1:9 | ||
| | ||
LL | #![deny(unreachable_code)] | ||
| ^^^^^^^^^^^^^^^^ | ||
note: any code following this expression is unreachable | ||
--> $DIR/issue-7246.rs:6:5 | ||
| | ||
LL | return; | ||
| ^^^^^^ | ||
|
||
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,19 +1,16 @@ | ||
error: unreachable statement | ||
--> $DIR/lint-attr-non-item-node.rs:7:9 | ||
| | ||
LL | break; | ||
| ----- any code following this expression is unreachable | ||
LL | "unreachable"; | ||
| ^^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^^ unreachable statement | ||
| | ||
note: lint level defined here | ||
--> $DIR/lint-attr-non-item-node.rs:4:12 | ||
| | ||
LL | #[deny(unreachable_code)] | ||
| ^^^^^^^^^^^^^^^^ | ||
note: any code following this expression is unreachable | ||
--> $DIR/lint-attr-non-item-node.rs:6:9 | ||
| | ||
LL | break; | ||
| ^^^^^ | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// check-pass | ||
// edition:2018 | ||
|
||
#[allow(dead_code)] | ||
async fn foo () { // unreachable lint doesn't trigger | ||
unimplemented!() | ||
} | ||
|
||
fn main() {} |
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,19 +1,16 @@ | ||
error: unreachable statement | ||
--> $DIR/match-no-arms-unreachable-after.rs:8:5 | ||
| | ||
LL | match v { } | ||
| ----------- any code following this expression is unreachable | ||
LL | let x = 2; | ||
| ^^^^^^^^^^ | ||
| ^^^^^^^^^^ unreachable statement | ||
| | ||
note: lint level defined here | ||
--> $DIR/match-no-arms-unreachable-after.rs:2:9 | ||
| | ||
LL | #![deny(unreachable_code)] | ||
| ^^^^^^^^^^^^^^^^ | ||
note: any code following this expression is unreachable | ||
--> $DIR/match-no-arms-unreachable-after.rs:7:5 | ||
| | ||
LL | match v { } | ||
| ^^^^^^^^^^^ | ||
|
||
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
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
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
Oops, something went wrong.