]> git.lizzy.rs Git - rust.git/commitdiff
Fix error message tests
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sat, 15 Jul 2017 21:32:52 +0000 (23:32 +0200)
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Fri, 28 Jul 2017 13:46:27 +0000 (15:46 +0200)
src/librustc_borrowck/diagnostics.rs

index 69b07912e571161eebe5be75fe1b5310bf31e4c2..f8511bc9c7dc166b80c6758f84ba374ad3a74821 100644 (file)
@@ -1189,6 +1189,7 @@ struct Foo<'a> {
 
 ```compile_fail,E0624
 # #![feature(generators)]
+# use std::ops::Generator;
 let mut b = || {
     let a = &3; // <-- This borrow...
     yield (); // ...is still in scope here, when the yield occurs.
@@ -1206,6 +1207,7 @@ struct Foo<'a> {
 
 ```
 # #![feature(generators)]
+# use std::ops::Generator;
 let mut b = || {
     let a = 3;
     yield ();
@@ -1222,6 +1224,7 @@ struct Foo<'a> {
 
 ```compile_fail,E0624
 # #![feature(generators)]
+# use std::ops::Generator;
 let mut b = || {
   let v = vec![1,2,3];
   for &x in &v { // <-- borrow of `v` is still in scope...
@@ -1236,6 +1239,7 @@ struct Foo<'a> {
 
 ```
 # #![feature(generators)]
+# use std::ops::Generator;
 let mut b = || {
   let v = vec![1,2,3];
   for x in v { // <-- Take ownership of the values instead!
@@ -1249,6 +1253,7 @@ struct Foo<'a> {
 
 ```
 # #![feature(generators)]
+# use std::ops::Generator;
 let mut b = || {
   let v = vec![1,2,3];
   let len = v.len(); // (*)