-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take in account the unreachable! macro in the non_fmt_panic lint
- Loading branch information
1 parent
5140d6d
commit 22f1800
Showing
9 changed files
with
161 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: format argument must be a string literal | ||
--> $DIR/unreachable-arg.rs:15:18 | ||
| | ||
LL | unreachable!(a); | ||
| ^ | ||
| | ||
help: you might be missing a string literal to format with | ||
| | ||
LL | unreachable!("{}", a); | ||
| +++++ | ||
|
||
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,16 @@ | ||
// ignore-emscripten no processes | ||
|
||
// revisions: edition_2015 edition_2021 | ||
// [edition_2015]edition:2015 | ||
// [edition_2021]edition:2021 | ||
// [edition_2015]run-fail | ||
// [edition_2021]check-fail | ||
// [edition_2015]error-pattern:internal error: entered unreachable code: hello | ||
// [edition_2021]error-pattern:format argument must be a string literal | ||
|
||
#![allow(non_fmt_panics)] | ||
|
||
fn main() { | ||
let a = "hello"; | ||
unreachable!(a); | ||
} |
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.