about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_assert.edition2021.stderr
blob: 004463720e26b80902ab2e9c1f74ef94654303b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:32:5
   |
LL | /     if !a.is_empty() {
LL | |         panic!("qaqaq{:?}", a);
LL | |     }
   | |_____^ help: try instead: `assert!(a.is_empty(), "qaqaq{:?}", a);`
   |
   = note: `-D clippy::manual-assert` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_assert)]`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:35:5
   |
LL | /     if !a.is_empty() {
LL | |         panic!("qwqwq");
LL | |     }
   | |_____^ help: try instead: `assert!(a.is_empty(), "qwqwq");`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:52:5
   |
LL | /     if b.is_empty() {
LL | |         panic!("panic1");
LL | |     }
   | |_____^ help: try instead: `assert!(!b.is_empty(), "panic1");`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:55:5
   |
LL | /     if b.is_empty() && a.is_empty() {
LL | |         panic!("panic2");
LL | |     }
   | |_____^ help: try instead: `assert!(!(b.is_empty() && a.is_empty()), "panic2");`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:58:5
   |
LL | /     if a.is_empty() && !b.is_empty() {
LL | |         panic!("panic3");
LL | |     }
   | |_____^ help: try instead: `assert!(!(a.is_empty() && !b.is_empty()), "panic3");`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:61:5
   |
LL | /     if b.is_empty() || a.is_empty() {
LL | |         panic!("panic4");
LL | |     }
   | |_____^ help: try instead: `assert!(!(b.is_empty() || a.is_empty()), "panic4");`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:64:5
   |
LL | /     if a.is_empty() || !b.is_empty() {
LL | |         panic!("panic5");
LL | |     }
   | |_____^ help: try instead: `assert!(!(a.is_empty() || !b.is_empty()), "panic5");`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:67:5
   |
LL | /     if a.is_empty() {
LL | |         panic!("with expansion {}", one!())
LL | |     }
   | |_____^ help: try instead: `assert!(!a.is_empty(), "with expansion {}", one!());`

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:79:5
   |
LL | /     if a > 2 {
LL | |         // comment
LL | |         /* this is a
LL | |         multiline
...  |
LL | |         panic!("panic with comment") // comment after `panic!`
LL | |     }
   | |_____^
   |
help: try instead
   |
LL |     assert!(!(a > 2), "panic with comment");
   |

error: only a `panic!` in `if`-then statement
  --> tests/ui/manual_assert.rs:93:25
   |
LL |           const BAR: () = if N == 0 {
   |  _________________________^
LL | |             panic!()
LL | |         };
   | |_________^ help: try instead: `assert!(!(N == 0), )`

error: aborting due to 10 previous errors