forked from rust-lang/rust-clippy
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #79145 - camelid:clippy-fix-panics, r=flip1995
Fix handling of panic calls This should make Clippy more resilient and will unblock #78343. This PR is made against rust-lang/rust to avoid the need for a subtree sync at ``@flip1995's`` suggestion in rust-lang#6310. r? ``@flip1995`` cc ``@m-ou-se``
- Loading branch information
Showing
9 changed files
with
106 additions
and
54 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
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,88 +1,112 @@ | ||
error: `panic` should not be present in production code | ||
--> $DIR/panicking_macros.rs:6:5 | ||
--> $DIR/panicking_macros.rs:8:5 | ||
| | ||
LL | panic!(); | ||
| ^^^^^^^^^ | ||
| | ||
= note: `-D clippy::panic` implied by `-D warnings` | ||
|
||
error: `panic` should not be present in production code | ||
--> $DIR/panicking_macros.rs:7:5 | ||
--> $DIR/panicking_macros.rs:9:5 | ||
| | ||
LL | panic!("message"); | ||
| ^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: `panic` should not be present in production code | ||
--> $DIR/panicking_macros.rs:8:5 | ||
--> $DIR/panicking_macros.rs:10:5 | ||
| | ||
LL | panic!("{} {}", "panic with", "multiple arguments"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: `todo` should not be present in production code | ||
--> $DIR/panicking_macros.rs:14:5 | ||
--> $DIR/panicking_macros.rs:16:5 | ||
| | ||
LL | todo!(); | ||
| ^^^^^^^^ | ||
| | ||
= note: `-D clippy::todo` implied by `-D warnings` | ||
|
||
error: `todo` should not be present in production code | ||
--> $DIR/panicking_macros.rs:15:5 | ||
--> $DIR/panicking_macros.rs:17:5 | ||
| | ||
LL | todo!("message"); | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: `todo` should not be present in production code | ||
--> $DIR/panicking_macros.rs:16:5 | ||
--> $DIR/panicking_macros.rs:18:5 | ||
| | ||
LL | todo!("{} {}", "panic with", "multiple arguments"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `unimplemented` should not be present in production code | ||
--> $DIR/panicking_macros.rs:22:5 | ||
--> $DIR/panicking_macros.rs:24:5 | ||
| | ||
LL | unimplemented!(); | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::unimplemented` implied by `-D warnings` | ||
|
||
error: `unimplemented` should not be present in production code | ||
--> $DIR/panicking_macros.rs:23:5 | ||
--> $DIR/panicking_macros.rs:25:5 | ||
| | ||
LL | unimplemented!("message"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `unimplemented` should not be present in production code | ||
--> $DIR/panicking_macros.rs:24:5 | ||
--> $DIR/panicking_macros.rs:26:5 | ||
| | ||
LL | unimplemented!("{} {}", "panic with", "multiple arguments"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: `unreachable` should not be present in production code | ||
--> $DIR/panicking_macros.rs:30:5 | ||
--> $DIR/panicking_macros.rs:32:5 | ||
| | ||
LL | unreachable!(); | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::unreachable` implied by `-D warnings` | ||
|
||
error: `unreachable` should not be present in production code | ||
--> $DIR/panicking_macros.rs:31:5 | ||
--> $DIR/panicking_macros.rs:33:5 | ||
| | ||
LL | unreachable!("message"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: `unreachable` should not be present in production code | ||
--> $DIR/panicking_macros.rs:32:5 | ||
--> $DIR/panicking_macros.rs:34:5 | ||
| | ||
LL | unreachable!("{} {}", "panic with", "multiple arguments"); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 12 previous errors | ||
error: `panic` should not be present in production code | ||
--> $DIR/panicking_macros.rs:40:5 | ||
| | ||
LL | panic!(); | ||
| ^^^^^^^^^ | ||
|
||
error: `todo` should not be present in production code | ||
--> $DIR/panicking_macros.rs:41:5 | ||
| | ||
LL | todo!(); | ||
| ^^^^^^^^ | ||
|
||
error: `unimplemented` should not be present in production code | ||
--> $DIR/panicking_macros.rs:42:5 | ||
| | ||
LL | unimplemented!(); | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: `unreachable` should not be present in production code | ||
--> $DIR/panicking_macros.rs:43:5 | ||
| | ||
LL | unreachable!(); | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 16 previous errors | ||
|