]> git.lizzy.rs Git - rust.git/commitdiff
Increase suggestion tests' context
authorPascal Hertleif <killercup@gmail.com>
Sat, 28 Jan 2017 13:12:35 +0000 (14:12 +0100)
committerPascal Hertleif <killercup@gmail.com>
Sat, 28 Jan 2017 13:12:35 +0000 (14:12 +0100)
tests/compile-fail/for_loop.rs

index 5e13b7783291fa3182ad83ee4350bf5ea4c9965f..2712d4a102393f30f3ce09da4ab3618586cfe208 100644 (file)
@@ -294,18 +294,18 @@ fn main() {
     for _v in vec.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&vec`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &vec
+    //~| SUGGESTION for _v in &vec {
 
     for _v in vec.iter_mut() { }
     //~^ ERROR it is more idiomatic to loop over `&mut vec`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION vec
+    //~| SUGGESTION for _v in &mut vec {
 
     let out_vec = vec![1,2,3];
     for _v in out_vec.into_iter() { }
     //~^ ERROR it is more idiomatic to loop over `out_vec` instead of `out_vec.into_iter()`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION out_vec
+    //~| SUGGESTION for _v in out_vec {
 
     for _v in &vec { } // these are fine
     for _v in &mut vec { } // these are fine
@@ -313,14 +313,14 @@ fn main() {
     for _v in [1, 2, 3].iter() { }
     //~^ ERROR it is more idiomatic to loop over `&[
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &[1, 2, 3]
+    //~| SUGGESTION for _v in &[1, 2, 3] {
 
     for _v in (&mut [1, 2, 3]).iter() { } // no error
 
     for _v in [0; 32].iter() {}
     //~^ ERROR it is more idiomatic to loop over `&[
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &[0; 32]
+    //~| SUGGESTION for _v in &[0; 32] {
 
     for _v in [0; 33].iter() {} // no error
 
@@ -328,43 +328,43 @@ fn main() {
     for _v in ll.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&ll`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &ll
+    //~| SUGGESTION for _v in &ll {
 
     let vd: VecDeque<()> = VecDeque::new();
     for _v in vd.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&vd`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &vd
+    //~| SUGGESTION for _v in &vd {
 
     let bh: BinaryHeap<()> = BinaryHeap::new();
     for _v in bh.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&bh`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &bh
+    //~| SUGGESTION for _v in &bh {
 
     let hm: HashMap<(), ()> = HashMap::new();
     for _v in hm.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&hm`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &hm
+    //~| SUGGESTION for _v in &hm {
 
     let bt: BTreeMap<(), ()> = BTreeMap::new();
     for _v in bt.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&bt`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &bt
+    //~| SUGGESTION for _v in &bt {
 
     let hs: HashSet<()> = HashSet::new();
     for _v in hs.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&hs`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &hs
+    //~| SUGGESTION for _v in &hs {
 
     let bs: BTreeSet<()> = BTreeSet::new();
     for _v in bs.iter() { }
     //~^ ERROR it is more idiomatic to loop over `&bs`
     //~| HELP to write this more concisely, try looping over
-    //~| SUGGESTION &bs
+    //~| SUGGESTION for _v in &bs {
 
 
     for _v in vec.iter().next() { } //~ERROR you are iterating over `Iterator::next()`