mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-24 12:03:28 +00:00
60 lines
1.8 KiB
Text
60 lines
1.8 KiB
Text
error: only a `panic!` in `if`-then statement
|
|
--> $DIR/manual_assert.rs:24:5
|
|
|
|
|
LL | / if !a.is_empty() {
|
|
LL | | panic!("qaqaq{:?}", a);
|
|
LL | | }
|
|
| |_____^ help: try: `assert!(a.is_empty(), "qaqaq{:?}", a);`
|
|
|
|
|
= note: `-D clippy::manual-assert` implied by `-D warnings`
|
|
|
|
error: only a `panic!` in `if`-then statement
|
|
--> $DIR/manual_assert.rs:27:5
|
|
|
|
|
LL | / if !a.is_empty() {
|
|
LL | | panic!("qwqwq");
|
|
LL | | }
|
|
| |_____^ help: try: `assert!(a.is_empty(), "qwqwq");`
|
|
|
|
error: only a `panic!` in `if`-then statement
|
|
--> $DIR/manual_assert.rs:44:5
|
|
|
|
|
LL | / if b.is_empty() {
|
|
LL | | panic!("panic1");
|
|
LL | | }
|
|
| |_____^ help: try: `assert!(!b.is_empty(), "panic1");`
|
|
|
|
error: only a `panic!` in `if`-then statement
|
|
--> $DIR/manual_assert.rs:47:5
|
|
|
|
|
LL | / if b.is_empty() && a.is_empty() {
|
|
LL | | panic!("panic2");
|
|
LL | | }
|
|
| |_____^ help: try: `assert!(!(b.is_empty() && a.is_empty()), "panic2");`
|
|
|
|
error: only a `panic!` in `if`-then statement
|
|
--> $DIR/manual_assert.rs:50:5
|
|
|
|
|
LL | / if a.is_empty() && !b.is_empty() {
|
|
LL | | panic!("panic3");
|
|
LL | | }
|
|
| |_____^ help: try: `assert!(!(a.is_empty() && !b.is_empty()), "panic3");`
|
|
|
|
error: only a `panic!` in `if`-then statement
|
|
--> $DIR/manual_assert.rs:53:5
|
|
|
|
|
LL | / if b.is_empty() || a.is_empty() {
|
|
LL | | panic!("panic4");
|
|
LL | | }
|
|
| |_____^ help: try: `assert!(!(b.is_empty() || a.is_empty()), "panic4");`
|
|
|
|
error: only a `panic!` in `if`-then statement
|
|
--> $DIR/manual_assert.rs:56:5
|
|
|
|
|
LL | / if a.is_empty() || !b.is_empty() {
|
|
LL | | panic!("panic5");
|
|
LL | | }
|
|
| |_____^ help: try: `assert!(!(a.is_empty() || !b.is_empty()), "panic5");`
|
|
|
|
error: aborting due to 7 previous errors
|
|
|