]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/panicking_macros.rs
Add 'compiler/rustc_codegen_cranelift/' from commit '793d26047f994e23415f8f6bb5686ff2...
[rust.git] / src / tools / clippy / tests / ui / panicking_macros.rs
1 #![warn(clippy::unimplemented, clippy::unreachable, clippy::todo, clippy::panic)]
2 #![allow(clippy::assertions_on_constants)]
3
4 fn panic() {
5     let a = 2;
6     panic!();
7     panic!("message");
8     panic!("{} {}", "panic with", "multiple arguments");
9     let b = a + 2;
10 }
11
12 fn todo() {
13     let a = 2;
14     todo!();
15     todo!("message");
16     todo!("{} {}", "panic with", "multiple arguments");
17     let b = a + 2;
18 }
19
20 fn unimplemented() {
21     let a = 2;
22     unimplemented!();
23     unimplemented!("message");
24     unimplemented!("{} {}", "panic with", "multiple arguments");
25     let b = a + 2;
26 }
27
28 fn unreachable() {
29     let a = 2;
30     unreachable!();
31     unreachable!("message");
32     unreachable!("{} {}", "panic with", "multiple arguments");
33     let b = a + 2;
34 }
35
36 fn main() {
37     panic();
38     todo();
39     unimplemented();
40     unreachable();
41 }