]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/hygienic-labels-in-let.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / hygienic-labels-in-let.rs
index e6c1046d1fa7c278cebfe27abef42ee5237f1e35..17c0299cf4dd7aaf8d6c73579a5b907891f789dd 100644 (file)
@@ -10,8 +10,6 @@
 
 // ignore-pretty: pprust doesn't print hygiene output
 
-#![feature(macro_rules)]
-
 macro_rules! loop_x {
     ($e: expr) => {
         // $e shouldn't be able to interact with this 'x
@@ -19,6 +17,13 @@ macro_rules! loop_x {
     }
 }
 
+macro_rules! while_true {
+    ($e: expr) => {
+        // $e shouldn't be able to interact with this 'x
+        'x: while 1i + 1 == 2 { $e }
+    }
+}
+
 macro_rules! run_once {
     ($e: expr) => {
         // ditto
@@ -49,6 +54,16 @@ pub fn main() {
     };
     assert_eq!(k, 1i);
 
+    let l: int = {
+        'x: for _ in range(0i, 1) {
+            // ditto
+            while_true!(break 'x);
+            i += 1;
+        }
+        i + 1
+    };
+    assert_eq!(l, 1i);
+
     let n: int = {
         'x: for _ in range(0i, 1) {
             // ditto