@@ -4,65 +4,121 @@ error: only a `panic!` in `if`-then statement
44LL | / if !a.is_empty() {
55LL | | panic!("qaqaq{:?}", a);
66LL | | }
7- | |_____^ help: try: `assert!(a.is_empty(), "qaqaq{:?}", a);`
7+ | |_____^
88 |
99 = note: `-D clippy::manual-assert` implied by `-D warnings`
10+ help: try instead
11+ |
12+ LL | assert!(a.is_empty(), "qaqaq{:?}", a);
13+ |
1014
1115error: only a `panic!` in `if`-then statement
1216 --> $DIR/manual_assert.rs:33:5
1317 |
1418LL | / if !a.is_empty() {
1519LL | | panic!("qwqwq");
1620LL | | }
17- | |_____^ help: try: `assert!(a.is_empty(), "qwqwq");`
21+ | |_____^
22+ |
23+ help: try instead
24+ |
25+ LL | assert!(a.is_empty(), "qwqwq");
26+ |
1827
1928error: only a `panic!` in `if`-then statement
2029 --> $DIR/manual_assert.rs:50:5
2130 |
2231LL | / if b.is_empty() {
2332LL | | panic!("panic1");
2433LL | | }
25- | |_____^ help: try: `assert!(!b.is_empty(), "panic1");`
34+ | |_____^
35+ |
36+ help: try instead
37+ |
38+ LL | assert!(!b.is_empty(), "panic1");
39+ |
2640
2741error: only a `panic!` in `if`-then statement
2842 --> $DIR/manual_assert.rs:53:5
2943 |
3044LL | / if b.is_empty() && a.is_empty() {
3145LL | | panic!("panic2");
3246LL | | }
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+ |
3453
3554error: only a `panic!` in `if`-then statement
3655 --> $DIR/manual_assert.rs:56:5
3756 |
3857LL | / if a.is_empty() && !b.is_empty() {
3958LL | | panic!("panic3");
4059LL | | }
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+ |
4266
4367error: only a `panic!` in `if`-then statement
4468 --> $DIR/manual_assert.rs:59:5
4569 |
4670LL | / if b.is_empty() || a.is_empty() {
4771LL | | panic!("panic4");
4872LL | | }
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+ |
5079
5180error: only a `panic!` in `if`-then statement
5281 --> $DIR/manual_assert.rs:62:5
5382 |
5483LL | / if a.is_empty() || !b.is_empty() {
5584LL | | panic!("panic5");
5685LL | | }
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+ |
5892
5993error: only a `panic!` in `if`-then statement
6094 --> $DIR/manual_assert.rs:65:5
6195 |
6296LL | / if a.is_empty() {
6397LL | | panic!("with expansion {}", one!())
6498LL | | }
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:72:5
108+ |
109+ LL | / if a > 2 {
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!(!(a > 2), "panic with comment");
121+ |
66122
67- error: aborting due to 8 previous errors
123+ error: aborting due to 9 previous errors
68124
0 commit comments