rust-clippy/tests/ui/checked_unwrap/complex_conditionals_nested.stderr

33 lines
1.1 KiB
Text
Raw Normal View History

error: called `unwrap` on `x` after checking its variant with `is_some`
2024-02-17 12:16:29 +00:00
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:13:13
2020-03-18 14:24:48 +00:00
|
LL | if x.is_some() {
2024-08-11 15:33:28 +00:00
| -------------- help: try: `if let Some(<item>) = x`
LL | // unnecessary
LL | x.unwrap();
2020-03-18 14:24:48 +00:00
| ^^^^^^^^^^
|
note: the lint level is defined here
2024-02-17 12:16:29 +00:00
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:1:35
2020-03-18 14:24:48 +00:00
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
2024-02-17 12:16:29 +00:00
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:17:13
2020-03-18 14:24:48 +00:00
|
LL | if x.is_some() {
| ----------- because of this check
...
LL | x.unwrap();
2020-03-18 14:24:48 +00:00
| ^^^^^^^^^^
|
note: the lint level is defined here
2024-02-17 12:16:29 +00:00
--> tests/ui/checked_unwrap/complex_conditionals_nested.rs:1:9
2020-03-18 14:24:48 +00:00
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors