11error: only a `panic!` in `if`-then statement
2- --> tests/ui/manual_assert.rs:32 :5
2+ --> tests/ui/manual_assert.rs:30 :5
33 |
44LL | / if !a.is_empty() {
55LL | | panic!("qaqaq{:?}", a);
66LL | | }
7- | |_____^ help: try instead : `assert!(a.is_empty(), "qaqaq{:?}", a);`
7+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(a.is_empty(), "qaqaq{:?}", a);`
88 |
99 = note: `-D clippy::manual-assert` implied by `-D warnings`
1010 = help: to override `-D warnings` add `#[allow(clippy::manual_assert)]`
1111
1212error: only a `panic!` in `if`-then statement
13- --> tests/ui/manual_assert.rs:35 :5
13+ --> tests/ui/manual_assert.rs:33 :5
1414 |
1515LL | / if !a.is_empty() {
1616LL | | panic!("qwqwq");
1717LL | | }
18- | |_____^ help: try instead : `assert!(a.is_empty(), "qwqwq");`
18+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(a.is_empty(), "qwqwq");`
1919
2020error: only a `panic!` in `if`-then statement
21- --> tests/ui/manual_assert.rs:52 :5
21+ --> tests/ui/manual_assert.rs:50 :5
2222 |
2323LL | / if b.is_empty() {
2424LL | | panic!("panic1");
2525LL | | }
26- | |_____^ help: try instead : `assert!(!b.is_empty(), "panic1");`
26+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(!b.is_empty(), "panic1");`
2727
2828error: only a `panic!` in `if`-then statement
29- --> tests/ui/manual_assert.rs:55 :5
29+ --> tests/ui/manual_assert.rs:53 :5
3030 |
3131LL | / if b.is_empty() && a.is_empty() {
3232LL | | panic!("panic2");
3333LL | | }
34- | |_____^ help: try instead : `assert!(!(b.is_empty() && a.is_empty()), "panic2");`
34+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(!(b.is_empty() && a.is_empty()), "panic2");`
3535
3636error: only a `panic!` in `if`-then statement
37- --> tests/ui/manual_assert.rs:58 :5
37+ --> tests/ui/manual_assert.rs:56 :5
3838 |
3939LL | / if a.is_empty() && !b.is_empty() {
4040LL | | panic!("panic3");
4141LL | | }
42- | |_____^ help: try instead : `assert!(!(a.is_empty() && !b.is_empty()), "panic3");`
42+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(!(a.is_empty() && !b.is_empty()), "panic3");`
4343
4444error: only a `panic!` in `if`-then statement
45- --> tests/ui/manual_assert.rs:61 :5
45+ --> tests/ui/manual_assert.rs:59 :5
4646 |
4747LL | / if b.is_empty() || a.is_empty() {
4848LL | | panic!("panic4");
4949LL | | }
50- | |_____^ help: try instead : `assert!(!(b.is_empty() || a.is_empty()), "panic4");`
50+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(!(b.is_empty() || a.is_empty()), "panic4");`
5151
5252error: only a `panic!` in `if`-then statement
53- --> tests/ui/manual_assert.rs:64 :5
53+ --> tests/ui/manual_assert.rs:62 :5
5454 |
5555LL | / if a.is_empty() || !b.is_empty() {
5656LL | | panic!("panic5");
5757LL | | }
58- | |_____^ help: try instead : `assert!(!(a.is_empty() || !b.is_empty()), "panic5");`
58+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(!(a.is_empty() || !b.is_empty()), "panic5");`
5959
6060error: only a `panic!` in `if`-then statement
61- --> tests/ui/manual_assert.rs:67 :5
61+ --> tests/ui/manual_assert.rs:65 :5
6262 |
6363LL | / if a.is_empty() {
6464LL | | panic!("with expansion {}", one!())
6565LL | | }
66- | |_____^ help: try instead : `assert!(!a.is_empty(), "with expansion {}", one!());`
66+ | |_____^ help: replace `if`-then-`panic!` with `assert!` : `assert!(!a.is_empty(), "with expansion {}", one!());`
6767
6868error: only a `panic!` in `if`-then statement
69- --> tests/ui/manual_assert.rs:79 :5
69+ --> tests/ui/manual_assert.rs:77 :5
7070 |
7171LL | / if a > 2 {
7272LL | | // comment
@@ -77,19 +77,19 @@ LL | | panic!("panic with comment") // comment after `panic!`
7777LL | | }
7878 | |_____^
7979 |
80- help: try instead
80+ help: replace `if`-then-`panic!` with `assert!`
8181 |
8282LL | assert!(!(a > 2), "panic with comment");
8383 |
8484
8585error: only a `panic!` in `if`-then statement
86- --> tests/ui/manual_assert.rs:93 :25
86+ --> tests/ui/manual_assert.rs:91 :25
8787 |
8888LL | const BAR: () = if N == 0 {
8989 | _________________________^
9090LL | | panic!()
9191LL | | };
92- | |_________^ help: try instead : `assert!(!(N == 0), )`
92+ | |_________^ help: replace `if`-then-`panic!` with `assert!` : `assert!(!(N == 0), )`
9393
9494error: aborting due to 10 previous errors
9595
0 commit comments