]> git.lizzy.rs Git - rust.git/commitdiff
Add a test for #2171
authortopecongiro <seuchida@gmail.com>
Mon, 20 Nov 2017 07:38:15 +0000 (16:38 +0900)
committertopecongiro <seuchida@gmail.com>
Mon, 20 Nov 2017 07:38:15 +0000 (16:38 +0900)
tests/source/closure.rs
tests/target/closure.rs

index c77354cf972c07389a7718c07faec63972ea0ce2..cab73b28c2a6511d32335dcbfe5d1280420f2549 100644 (file)
@@ -188,3 +188,13 @@ fn issue1524() {
     let f = |x| {x};
     let f = |x| x;
 }
+
+fn issue2171() {
+    foo(|| unsafe {
+        if PERIPHERALS {
+            loop {}
+        } else {
+            PERIPHERALS = true;
+        }
+    })
+}
index 7756567937ed99ac421d8ab955f723699b6efb85..c3a3af50bb861df59240bfa4f53909b1527f76c2 100644 (file)
@@ -220,3 +220,13 @@ fn issue1524() {
     let f = |x| x;
     let f = |x| x;
 }
+
+fn issue2171() {
+    foo(|| unsafe {
+        if PERIPHERALS {
+            loop {}
+        } else {
+            PERIPHERALS = true;
+        }
+    })
+}