|
1 | 1 | error: only a `panic!` in `if`-then statement |
2 | | - --> $DIR/manual_assert.rs:30:5 |
| 2 | + --> $DIR/manual_assert.rs:31:5 |
3 | 3 | | |
4 | 4 | LL | / if !a.is_empty() { |
5 | 5 | LL | | panic!("qaqaq{:?}", a); |
6 | 6 | LL | | } |
7 | | - | |_____^ help: try: `assert!(a.is_empty(), "qaqaq{:?}", a);` |
| 7 | + | |_____^ |
8 | 8 | | |
9 | 9 | = note: `-D clippy::manual-assert` implied by `-D warnings` |
| 10 | +help: try instead |
| 11 | + | |
| 12 | +LL | assert!(!(!a.is_empty()), "qaqaq{:?}", a); |
| 13 | + | |
10 | 14 |
|
11 | 15 | error: only a `panic!` in `if`-then statement |
12 | | - --> $DIR/manual_assert.rs:33:5 |
| 16 | + --> $DIR/manual_assert.rs:34:5 |
13 | 17 | | |
14 | 18 | LL | / if !a.is_empty() { |
15 | 19 | LL | | panic!("qwqwq"); |
16 | 20 | LL | | } |
17 | | - | |_____^ help: try: `assert!(a.is_empty(), "qwqwq");` |
| 21 | + | |_____^ |
| 22 | + | |
| 23 | +help: try instead |
| 24 | + | |
| 25 | +LL | assert!(!(!a.is_empty()), "qwqwq"); |
| 26 | + | |
18 | 27 |
|
19 | 28 | error: only a `panic!` in `if`-then statement |
20 | | - --> $DIR/manual_assert.rs:50:5 |
| 29 | + --> $DIR/manual_assert.rs:51:5 |
21 | 30 | | |
22 | 31 | LL | / if b.is_empty() { |
23 | 32 | LL | | panic!("panic1"); |
24 | 33 | LL | | } |
25 | | - | |_____^ help: try: `assert!(!b.is_empty(), "panic1");` |
| 34 | + | |_____^ |
| 35 | + | |
| 36 | +help: try instead |
| 37 | + | |
| 38 | +LL | assert!(!b.is_empty(), "panic1"); |
| 39 | + | |
26 | 40 |
|
27 | 41 | error: only a `panic!` in `if`-then statement |
28 | | - --> $DIR/manual_assert.rs:53:5 |
| 42 | + --> $DIR/manual_assert.rs:54:5 |
29 | 43 | | |
30 | 44 | LL | / if b.is_empty() && a.is_empty() { |
31 | 45 | LL | | panic!("panic2"); |
32 | 46 | LL | | } |
33 | | - | |_____^ help: try: `assert!(!(b.is_empty() && a.is_empty()), "panic2");` |
| 47 | + | |_____^ |
| 48 | + | |
| 49 | +help: try instead |
| 50 | + | |
| 51 | +LL | assert!(!(b.is_empty() && a.is_empty()), "panic2"); |
| 52 | + | |
34 | 53 |
|
35 | 54 | error: only a `panic!` in `if`-then statement |
36 | | - --> $DIR/manual_assert.rs:56:5 |
| 55 | + --> $DIR/manual_assert.rs:57:5 |
37 | 56 | | |
38 | 57 | LL | / if a.is_empty() && !b.is_empty() { |
39 | 58 | LL | | panic!("panic3"); |
40 | 59 | LL | | } |
41 | | - | |_____^ help: try: `assert!(!(a.is_empty() && !b.is_empty()), "panic3");` |
| 60 | + | |_____^ |
| 61 | + | |
| 62 | +help: try instead |
| 63 | + | |
| 64 | +LL | assert!(!(a.is_empty() && !b.is_empty()), "panic3"); |
| 65 | + | |
42 | 66 |
|
43 | 67 | error: only a `panic!` in `if`-then statement |
44 | | - --> $DIR/manual_assert.rs:59:5 |
| 68 | + --> $DIR/manual_assert.rs:60:5 |
45 | 69 | | |
46 | 70 | LL | / if b.is_empty() || a.is_empty() { |
47 | 71 | LL | | panic!("panic4"); |
48 | 72 | LL | | } |
49 | | - | |_____^ help: try: `assert!(!(b.is_empty() || a.is_empty()), "panic4");` |
| 73 | + | |_____^ |
| 74 | + | |
| 75 | +help: try instead |
| 76 | + | |
| 77 | +LL | assert!(!(b.is_empty() || a.is_empty()), "panic4"); |
| 78 | + | |
50 | 79 |
|
51 | 80 | error: only a `panic!` in `if`-then statement |
52 | | - --> $DIR/manual_assert.rs:62:5 |
| 81 | + --> $DIR/manual_assert.rs:63:5 |
53 | 82 | | |
54 | 83 | LL | / if a.is_empty() || !b.is_empty() { |
55 | 84 | LL | | panic!("panic5"); |
56 | 85 | LL | | } |
57 | | - | |_____^ help: try: `assert!(!(a.is_empty() || !b.is_empty()), "panic5");` |
| 86 | + | |_____^ |
| 87 | + | |
| 88 | +help: try instead |
| 89 | + | |
| 90 | +LL | assert!(!(a.is_empty() || !b.is_empty()), "panic5"); |
| 91 | + | |
58 | 92 |
|
59 | 93 | error: only a `panic!` in `if`-then statement |
60 | | - --> $DIR/manual_assert.rs:65:5 |
| 94 | + --> $DIR/manual_assert.rs:66:5 |
61 | 95 | | |
62 | 96 | LL | / if a.is_empty() { |
63 | 97 | LL | | panic!("with expansion {}", one!()) |
64 | 98 | LL | | } |
65 | | - | |_____^ help: try: `assert!(!a.is_empty(), "with expansion {}", one!());` |
| 99 | + | |_____^ |
| 100 | + | |
| 101 | +help: try instead |
| 102 | + | |
| 103 | +LL | assert!(!a.is_empty(), "with expansion {}", one!()); |
| 104 | + | |
| 105 | + |
| 106 | +error: only a `panic!` in `if`-then statement |
| 107 | + --> $DIR/manual_assert.rs:73:5 |
| 108 | + | |
| 109 | +LL | / if true { |
| 110 | +LL | | // comment |
| 111 | +LL | | /* this is a |
| 112 | +LL | | multiline |
| 113 | +... | |
| 114 | +LL | | panic!("panic with comment") // comment after `panic!` |
| 115 | +LL | | } |
| 116 | + | |_____^ |
| 117 | + | |
| 118 | +help: try instead |
| 119 | + | |
| 120 | +LL | assert!(!true, "panic with comment"); |
| 121 | + | |
66 | 122 |
|
67 | | -error: aborting due to 8 previous errors |
| 123 | +error: aborting due to 9 previous errors |
68 | 124 |
|
0 commit comments