2021-09-28 17:03:12 +00:00
|
|
|
error: only a `panic!` in `if`-then statement
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:30:5
|
2021-09-28 17:03:12 +00:00
|
|
|
|
|
|
|
|
LL | / if !a.is_empty() {
|
|
|
|
LL | | panic!("qaqaq{:?}", a);
|
|
|
|
LL | | }
|
2022-10-11 16:17:59 +00:00
|
|
|
| |_____^ help: try instead: `assert!(a.is_empty(), "qaqaq{:?}", a);`
|
2021-09-28 17:03:12 +00:00
|
|
|
|
|
2021-11-04 12:52:36 +00:00
|
|
|
= note: `-D clippy::manual-assert` implied by `-D warnings`
|
2021-09-28 17:03:12 +00:00
|
|
|
|
2023-02-01 21:51:02 +00:00
|
|
|
error: only a `panic!` in `if`-then statement
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:33:5
|
2023-02-01 21:51:02 +00:00
|
|
|
|
|
|
|
|
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
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:50:5
|
2023-02-01 21:51:02 +00:00
|
|
|
|
|
|
|
|
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
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:53:5
|
2023-02-01 21:51:02 +00:00
|
|
|
|
|
|
|
|
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
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:56:5
|
2023-02-01 21:51:02 +00:00
|
|
|
|
|
|
|
|
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
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:59:5
|
2023-02-01 21:51:02 +00:00
|
|
|
|
|
|
|
|
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
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:62:5
|
2023-02-01 21:51:02 +00:00
|
|
|
|
|
|
|
|
LL | / if a.is_empty() || !b.is_empty() {
|
|
|
|
LL | | panic!("panic5");
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try instead: `assert!(!(a.is_empty() || !b.is_empty()), "panic5");`
|
|
|
|
|
2022-02-10 17:40:06 +00:00
|
|
|
error: only a `panic!` in `if`-then statement
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:65:5
|
2022-02-10 17:40:06 +00:00
|
|
|
|
|
|
|
|
LL | / if a.is_empty() {
|
|
|
|
LL | | panic!("with expansion {}", one!())
|
|
|
|
LL | | }
|
2022-10-11 16:17:59 +00:00
|
|
|
| |_____^ help: try instead: `assert!(!a.is_empty(), "with expansion {}", one!());`
|
2022-10-06 07:44:38 +00:00
|
|
|
|
2023-02-01 21:51:02 +00:00
|
|
|
error: only a `panic!` in `if`-then statement
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/manual_assert.rs:77:5
|
2023-02-01 21:51:02 +00:00
|
|
|
|
|
|
|
|
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: aborting due to 9 previous errors
|
2021-09-28 17:03:12 +00:00
|
|
|
|