]> git.lizzy.rs Git - rust.git/commitdiff
Fix error message tests
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>
Sat, 15 Jul 2017 20:40:46 +0000 (22:40 +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 14454267c99cc60f9a0c5440ccac1fb2912e34b6..69b07912e571161eebe5be75fe1b5310bf31e4c2 100644 (file)
@@ -1188,6 +1188,7 @@ struct Foo<'a> {
 yield point.
 
 ```compile_fail,E0624
+# #![feature(generators)]
 let mut b = || {
     let a = &3; // <-- This borrow...
     yield (); // ...is still in scope here, when the yield occurs.
@@ -1204,6 +1205,7 @@ struct Foo<'a> {
 the integer by value:
 
 ```
+# #![feature(generators)]
 let mut b = || {
     let a = 3;
     yield ();
@@ -1219,6 +1221,7 @@ struct Foo<'a> {
 This error also frequently arises with iteration:
 
 ```compile_fail,E0624
+# #![feature(generators)]
 let mut b = || {
   let v = vec![1,2,3];
   for &x in &v { // <-- borrow of `v` is still in scope...
@@ -1232,6 +1235,7 @@ struct Foo<'a> {
 `into_iter()`) to avoid borrowing:
 
 ```
+# #![feature(generators)]
 let mut b = || {
   let v = vec![1,2,3];
   for x in v { // <-- Take ownership of the values instead!
@@ -1244,6 +1248,7 @@ struct Foo<'a> {
 If taking ownership is not an option, using indices can work too:
 
 ```
+# #![feature(generators)]
 let mut b = || {
   let v = vec![1,2,3];
   let len = v.len(); // (*)