about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-02 02:31:29 -0700
committerbors <bors@rust-lang.org>2013-10-02 02:31:29 -0700
commitd00c9269dce3a7925d7d0bf5edb64b3c6747c6af (patch)
tree2446c316e34164e1b0795fb909de8951d503fe20 /src/test
parent97cd495aca946d088e103d364d3be34f2bfaf1e1 (diff)
parent4f67dcb24adb1e23f04e624fcbaf2328b82491b6 (diff)
auto merge of #9665 : alexcrichton/rust/snapshot, r=brson
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/shootout-k-nucleotide-pipes.rs2
-rw-r--r--src/test/bench/shootout-reverse-complement.rs2
-rw-r--r--src/test/compile-fail/borrowck-lend-flow-loop.rs2
-rw-r--r--src/test/compile-fail/loop-as-continue.rs15
-rw-r--r--src/test/run-pass/break.rs6
-rw-r--r--src/test/run-pass/foreach-external-iterators-loop.rs2
-rw-r--r--src/test/run-pass/issue-2216.rs2
-rw-r--r--src/test/run-pass/loop-break-cont.rs4
-rw-r--r--src/test/run-pass/terminate-in-initializer.rs2
-rw-r--r--src/test/run-pass/weird-exprs.rs2
10 files changed, 27 insertions, 12 deletions
diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs
index 3b8bd444c17..ff7e7192b9f 100644
--- a/src/test/bench/shootout-k-nucleotide-pipes.rs
+++ b/src/test/bench/shootout-k-nucleotide-pipes.rs
@@ -196,7 +196,7 @@ fn main() {
    while !rdr.eof() {
       let line: ~str = rdr.read_line();
 
-      if line.len() == 0u { loop; }
+      if line.len() == 0u { continue; }
 
       match (line[0] as char, proc_mode) {
 
diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs
index 6ce62ccd127..d7a7fe00185 100644
--- a/src/test/bench/shootout-reverse-complement.rs
+++ b/src/test/bench/shootout-reverse-complement.rs
@@ -130,7 +130,7 @@ fn main() {
                        stdout);
 
                 pos = 0;
-                loop;
+                continue;
             }
 
             // Complement other lines.
diff --git a/src/test/compile-fail/borrowck-lend-flow-loop.rs b/src/test/compile-fail/borrowck-lend-flow-loop.rs
index fff8a258479..99112985be6 100644
--- a/src/test/compile-fail/borrowck-lend-flow-loop.rs
+++ b/src/test/compile-fail/borrowck-lend-flow-loop.rs
@@ -135,7 +135,7 @@ fn loop_loop_pops_scopes<'r>(_v: &'r mut [uint], f: &fn(&'r mut uint) -> bool) {
             // this borrow is limited to the scope of `r`...
             let r: &'r mut uint = produce();
             if !f(&mut *r) {
-                loop; // ...so it is not live as exit (and re-enter) the `while` loop here
+                continue; // ...so it is not live as exit (and re-enter) the `while` loop here
             }
         }
     }
diff --git a/src/test/compile-fail/loop-as-continue.rs b/src/test/compile-fail/loop-as-continue.rs
new file mode 100644
index 00000000000..e4273fdfeff
--- /dev/null
+++ b/src/test/compile-fail/loop-as-continue.rs
@@ -0,0 +1,15 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    loop {
+        loop //~ ERROR: `loop` instead of `continue`
+    }
+}
diff --git a/src/test/run-pass/break.rs b/src/test/run-pass/break.rs
index 5903e421465..1ae77bc1eca 100644
--- a/src/test/run-pass/break.rs
+++ b/src/test/run-pass/break.rs
@@ -19,15 +19,15 @@ pub fn main() {
         if *x == 3 { break; } assert!((*x <= 3));
     }
     i = 0;
-    while i < 10 { i += 1; if i % 2 == 0 { loop; } assert!((i % 2 != 0)); }
+    while i < 10 { i += 1; if i % 2 == 0 { continue; } assert!((i % 2 != 0)); }
     i = 0;
     loop {
-        i += 1; if i % 2 == 0 { loop; } assert!((i % 2 != 0));
+        i += 1; if i % 2 == 0 { continue; } assert!((i % 2 != 0));
         if i >= 10 { break; }
     }
     let ys = ~[1, 2, 3, 4, 5, 6];
     for x in ys.iter() {
-        if *x % 2 == 0 { loop; }
+        if *x % 2 == 0 { continue; }
         assert!((*x % 2 != 0));
     }
 }
diff --git a/src/test/run-pass/foreach-external-iterators-loop.rs b/src/test/run-pass/foreach-external-iterators-loop.rs
index ced538e163e..37576874312 100644
--- a/src/test/run-pass/foreach-external-iterators-loop.rs
+++ b/src/test/run-pass/foreach-external-iterators-loop.rs
@@ -13,7 +13,7 @@ pub fn main() {
     let mut y = 0;
     for (n,i) in x.iter().enumerate() {
         if n < 10 {
-            loop;
+            continue;
         }
         y += *i;
     }
diff --git a/src/test/run-pass/issue-2216.rs b/src/test/run-pass/issue-2216.rs
index 4ad7d9500f6..f51a49e9c7b 100644
--- a/src/test/run-pass/issue-2216.rs
+++ b/src/test/run-pass/issue-2216.rs
@@ -21,7 +21,7 @@ pub fn main() {
                     break 'bar;
                 }
             }
-            loop 'foo;
+            continue 'foo;
         }
         x = 42;
         break;
diff --git a/src/test/run-pass/loop-break-cont.rs b/src/test/run-pass/loop-break-cont.rs
index 396946ce5a0..812089fd5a5 100644
--- a/src/test/run-pass/loop-break-cont.rs
+++ b/src/test/run-pass/loop-break-cont.rs
@@ -27,7 +27,7 @@ pub fn main() {
     is_even = false;
     i += 1u;
     if i % 2u != 0u {
-        loop;
+        continue;
     }
     is_even = true;
   }
@@ -40,7 +40,7 @@ pub fn main() {
     is_even = false;
     i += 1u;
     if i % 2u != 0u {
-        loop;
+        continue;
     }
     is_even = true;
   }
diff --git a/src/test/run-pass/terminate-in-initializer.rs b/src/test/run-pass/terminate-in-initializer.rs
index a2ba9e69bed..37cbc2b40de 100644
--- a/src/test/run-pass/terminate-in-initializer.rs
+++ b/src/test/run-pass/terminate-in-initializer.rs
@@ -17,7 +17,7 @@ use std::task;
 
 fn test_break() { loop { let _x: @int = break; } }
 
-fn test_cont() { let mut i = 0; while i < 1 { i += 1; let _x: @int = loop; } }
+fn test_cont() { let mut i = 0; while i < 1 { i += 1; let _x: @int = continue; } }
 
 fn test_ret() { let _x: @int = return; }
 
diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs
index 16070049151..9de4e295294 100644
--- a/src/test/run-pass/weird-exprs.rs
+++ b/src/test/run-pass/weird-exprs.rs
@@ -67,7 +67,7 @@ fn canttouchthis() -> uint {
 fn angrydome() {
     loop { if break { } }
     let mut i = 0;
-    loop { i += 1; if i == 1 { match (loop) { 1 => { }, _ => fail2!("wat") } }
+    loop { i += 1; if i == 1 { match (continue) { 1 => { }, _ => fail2!("wat") } }
       break; }
 }