rust-clippy/tests/ui/manual_assert.edition2018.stderr

30 lines
652 B
Text
Raw Normal View History

2021-09-14 08:28:09 +00:00
error: only a `panic!` in `if`-then statement
--> $DIR/manual_assert.rs:31:5
2021-09-14 08:28:09 +00:00
|
LL | / if !a.is_empty() {
LL | | panic!("qaqaq{:?}", a);
LL | | }
| |_____^
2021-09-14 08:28:09 +00:00
|
2021-10-12 14:23:05 +00:00
= note: `-D clippy::manual-assert` implied by `-D warnings`
help: try instead
|
LL | assert!(a.is_empty(), "qaqaq{:?}", a);
|
2021-09-14 08:28:09 +00:00
error: only a `panic!` in `if`-then statement
--> $DIR/manual_assert.rs:66:5
|
LL | / if a.is_empty() {
LL | | panic!("with expansion {}", one!())
LL | | }
| |_____^
|
help: try instead
|
LL | assert!(!a.is_empty(), "with expansion {}", one!());
|
2022-10-13 11:40:13 +00:00
error: aborting due to 2 previous errors
2021-09-14 08:28:09 +00:00