mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 01:17:16 +00:00
issue_6357 update unreachable macro usage
This commit is contained in:
parent
7a73a25622
commit
76f2c10fb6
2 changed files with 6 additions and 11 deletions
|
@ -66,7 +66,7 @@ declare_clippy_lint! {
|
|||
/// ```
|
||||
pub UNREACHABLE,
|
||||
restriction,
|
||||
"`unreachable!` should not be present in production code"
|
||||
"usage of the `unreachable!` macro"
|
||||
}
|
||||
|
||||
declare_lint_pass!(PanicUnimplemented => [UNIMPLEMENTED, UNREACHABLE, TODO, PANIC]);
|
||||
|
@ -85,12 +85,7 @@ impl<'tcx> LateLintPass<'tcx> for PanicUnimplemented {
|
|||
} else if is_expn_of(expr.span, "todo").is_some() {
|
||||
span_lint(cx, TODO, span, "`todo` should not be present in production code");
|
||||
} else if is_expn_of(expr.span, "unreachable").is_some() {
|
||||
span_lint(
|
||||
cx,
|
||||
UNREACHABLE,
|
||||
span,
|
||||
"`unreachable` should not be present in production code",
|
||||
);
|
||||
span_lint(cx, UNREACHABLE, span, "usage of the `unreachable!` macro");
|
||||
} else if is_expn_of(expr.span, "panic").is_some() {
|
||||
span_lint(cx, PANIC, span, "`panic` should not be present in production code");
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ error: `unimplemented` should not be present in production code
|
|||
LL | unimplemented!("{} {}", "panic with", "multiple arguments");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `unreachable` should not be present in production code
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:32:5
|
||||
|
|
||||
LL | unreachable!();
|
||||
|
@ -70,7 +70,7 @@ LL | unreachable!();
|
|||
|
|
||||
= note: `-D clippy::unreachable` implied by `-D warnings`
|
||||
|
||||
error: `unreachable` should not be present in production code
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:33:5
|
||||
|
|
||||
LL | unreachable!("message");
|
||||
|
@ -78,7 +78,7 @@ 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
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:34:5
|
||||
|
|
||||
LL | unreachable!("{} {}", "panic with", "multiple arguments");
|
||||
|
@ -102,7 +102,7 @@ error: `unimplemented` should not be present in production code
|
|||
LL | unimplemented!();
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `unreachable` should not be present in production code
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:43:5
|
||||
|
|
||||
LL | unreachable!();
|
||||
|
|
Loading…
Reference in a new issue