From: bors Date: Tue, 7 May 2019 04:35:42 +0000 (+0000) Subject: Auto merge of #4064 - mikerite:fix-771, r=matthiaskrgr X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=089a7beb7d7094c3fe8152c7a7c7c739c186fd62;hp=e9a3b7c4ee91b2b5713ffb16c6520e4cd7539ad2;p=rust.git Auto merge of #4064 - mikerite:fix-771, r=matthiaskrgr Add test for #771. Closes #771 changelog: none --- diff --git a/tests/ui/while_loop.rs b/tests/ui/while_loop.rs index 005ce141d27..a8506553e92 100644 --- a/tests/ui/while_loop.rs +++ b/tests/ui/while_loop.rs @@ -238,3 +238,18 @@ fn issue3670() { let _ = elem.or_else(|| *iter.next()?); } } + +fn issue771() { + let mut a = 100; + let b = Some(true); + loop { + if a > 10 { + break; + } + + match b { + Some(_) => a = 0, + None => break, + } + } +}