diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/panicking_macros.rs | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/panicking_macros.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/panicking_macros.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/panicking_macros.rs b/src/tools/clippy/tests/ui/panicking_macros.rs index 041ef17fa..dccfbd409 100644 --- a/src/tools/clippy/tests/ui/panicking_macros.rs +++ b/src/tools/clippy/tests/ui/panicking_macros.rs @@ -21,41 +21,61 @@ fn inline_const() { fn panic() { let a = 2; panic!(); + //~^ ERROR: `panic` should not be present in production code + //~| NOTE: `-D clippy::panic` implied by `-D warnings` panic!("message"); + //~^ ERROR: `panic` should not be present in production code panic!("{} {}", "panic with", "multiple arguments"); + //~^ ERROR: `panic` should not be present in production code let b = a + 2; } fn todo() { let a = 2; todo!(); + //~^ ERROR: `todo` should not be present in production code + //~| NOTE: `-D clippy::todo` implied by `-D warnings` todo!("message"); + //~^ ERROR: `todo` should not be present in production code todo!("{} {}", "panic with", "multiple arguments"); + //~^ ERROR: `todo` should not be present in production code let b = a + 2; } fn unimplemented() { let a = 2; unimplemented!(); + //~^ ERROR: `unimplemented` should not be present in production code + //~| NOTE: `-D clippy::unimplemented` implied by `-D warnings` unimplemented!("message"); + //~^ ERROR: `unimplemented` should not be present in production code unimplemented!("{} {}", "panic with", "multiple arguments"); + //~^ ERROR: `unimplemented` should not be present in production code let b = a + 2; } fn unreachable() { let a = 2; unreachable!(); + //~^ ERROR: usage of the `unreachable!` macro + //~| NOTE: `-D clippy::unreachable` implied by `-D warnings` unreachable!("message"); + //~^ ERROR: usage of the `unreachable!` macro unreachable!("{} {}", "panic with", "multiple arguments"); + //~^ ERROR: usage of the `unreachable!` macro let b = a + 2; } fn core_versions() { use core::{panic, todo, unimplemented, unreachable}; panic!(); + //~^ ERROR: `panic` should not be present in production code todo!(); + //~^ ERROR: `todo` should not be present in production code unimplemented!(); + //~^ ERROR: `unimplemented` should not be present in production code unreachable!(); + //~^ ERROR: usage of the `unreachable!` macro } fn assert() { |