]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/block_in_if_condition.rs
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / block_in_if_condition.rs
index 10342ed28b5757e94b2db10eb3a168fd878cd561..50f238814a31e4f366b127feb5c40c107131484d 100644 (file)
@@ -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());
+}