diff --git a/tests/ui/block_in_if_condition.rs b/tests/ui/block_in_if_condition.rs index 10342ed28b57..50f238814a31 100644 --- a/tests/ui/block_in_if_condition.rs +++ b/tests/ui/block_in_if_condition.rs @@ -103,3 +103,15 @@ fn macro_in_closure() { unimplemented!() } } + +fn block_in_assert() { + let opt = Some(42); + assert!(opt + .as_ref() + .and_then(|val| { + let mut v = val * 2; + v -= 1; + Some(v * 3) + }) + .is_some()); +}