From e7d8cf85117c680f3e6dccc87b210a85512b9850 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 27 Aug 2019 09:43:19 +0200 Subject: [PATCH] Add test for external macro --- tests/ui/block_in_if_condition.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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()); +}