diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs')
-rw-r--r-- | src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs b/src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs index e417cf833..68923793d 100644 --- a/src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs +++ b/src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs @@ -4,14 +4,18 @@ clippy::branches_sharing_code, clippy::unnecessary_literal_unwrap )] - +//@no-rustfix fn test_nested() { fn nested() { let x = Some(()); if x.is_some() { - x.unwrap(); // unnecessary + // unnecessary + x.unwrap(); + //~^ ERROR: called `unwrap` on `x` after checking its variant with `is_some` } else { - x.unwrap(); // will panic + // will panic + x.unwrap(); + //~^ ERROR: this call to `unwrap()` will always panic } } } |