]> git.lizzy.rs Git - rust.git/blob - tests/ui/panicking_macros.rs
Auto merge of #4809 - iankronquist:patch-1, r=flip1995
[rust.git] / 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     let b = a + 2;
8 }
9
10 fn todo() {
11     let a = 2;
12     todo!();
13     let b = a + 2;
14 }
15
16 fn unimplemented() {
17     let a = 2;
18     unimplemented!();
19     let b = a + 2;
20 }
21
22 fn unreachable() {
23     let a = 2;
24     unreachable!();
25     let b = a + 2;
26 }
27
28 fn main() {
29     panic();
30     todo();
31     unimplemented();
32     unreachable();
33 }