diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-02-23 03:42:32 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-02-26 20:24:02 +0300 |
| commit | fa2d9fc4b9e578d95fbf65613d1bf732fbdfb0d4 (patch) | |
| tree | 1eb1a49b4750e2704d3d724fb4a12ea4e2237eff /src/test/ui/borrowck | |
| parent | cdbd8c2f2aa69c4b8fe6f004449440e87c4ab87e (diff) | |
Update UI tests
Diffstat (limited to 'src/test/ui/borrowck')
21 files changed, 211 insertions, 211 deletions
diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.stderr b/src/test/ui/borrowck/borrowck-box-insensitivity.stderr index 1df7be00a78..d8c653037b8 100644 --- a/src/test/ui/borrowck/borrowck-box-insensitivity.stderr +++ b/src/test/ui/borrowck/borrowck-box-insensitivity.stderr @@ -1,10 +1,10 @@ error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:37:9 | -35 | let _x = a.x; +LL | let _x = a.x; | -- value moved here 36 | //~^ value moved here -37 | let _y = a.y; //~ ERROR use of moved +LL | let _y = a.y; //~ ERROR use of moved | ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait @@ -12,10 +12,10 @@ error[E0382]: use of moved value: `a` error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:46:9 | -44 | let _x = a.x; +LL | let _x = a.x; | -- value moved here 45 | //~^ value moved here -46 | let _y = a.y; //~ ERROR use of moved +LL | let _y = a.y; //~ ERROR use of moved | ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait @@ -23,10 +23,10 @@ error[E0382]: use of moved value: `a` error[E0382]: use of moved value: `a` --> $DIR/borrowck-box-insensitivity.rs:55:15 | -53 | let _x = a.x; +LL | let _x = a.x; | -- value moved here 54 | //~^ value moved here -55 | let _y = &a.y; //~ ERROR use of moved +LL | let _y = &a.y; //~ ERROR use of moved | ^^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait @@ -34,130 +34,130 @@ error[E0382]: use of moved value: `a` error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:63:9 | -62 | let _x = &a.x; +LL | let _x = &a.x; | --- borrow of `a.x` occurs here -63 | let _y = a.y; +LL | let _y = a.y; | ^^ move out of `a.y` occurs here error[E0503]: cannot use `a.y` because it was mutably borrowed --> $DIR/borrowck-box-insensitivity.rs:71:9 | -70 | let _x = &mut a.x; +LL | let _x = &mut a.x; | --- borrow of `a.x` occurs here -71 | let _y = a.y; //~ ERROR cannot use +LL | let _y = a.y; //~ ERROR cannot use | ^^ use of borrowed `a.x` error[E0505]: cannot move out of `a.y` because it is borrowed --> $DIR/borrowck-box-insensitivity.rs:77:9 | -76 | let _x = &mut a.x; +LL | let _x = &mut a.x; | --- borrow of `a.x` occurs here -77 | let _y = a.y; +LL | let _y = a.y; | ^^ move out of `a.y` occurs here error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also borrowed as mutable (via `a.x`) --> $DIR/borrowck-box-insensitivity.rs:85:15 | -84 | let _x = &mut a.x; +LL | let _x = &mut a.x; | --- mutable borrow occurs here (via `a.x`) -85 | let _y = &a.y; //~ ERROR cannot borrow +LL | let _y = &a.y; //~ ERROR cannot borrow | ^^^ immutable borrow occurs here (via `a.y`) 86 | //~^ immutable borrow occurs here (via `a.y`) -87 | } +LL | } | - mutable borrow ends here error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borrowed as immutable (via `a.x`) --> $DIR/borrowck-box-insensitivity.rs:92:19 | -91 | let _x = &a.x; +LL | let _x = &a.x; | --- immutable borrow occurs here (via `a.x`) -92 | let _y = &mut a.y; //~ ERROR cannot borrow +LL | let _y = &mut a.y; //~ ERROR cannot borrow | ^^^ mutable borrow occurs here (via `a.y`) 93 | //~^ mutable borrow occurs here (via `a.y`) -94 | } +LL | } | - immutable borrow ends here error[E0382]: use of collaterally moved value: `a.y` - --> $DIR/borrowck-box-insensitivity.rs:100:9 - | -98 | let _x = a.x.x; - | -- value moved here -99 | //~^ value moved here -100 | let _y = a.y; //~ ERROR use of collaterally moved - | ^^ value used here after move - | - = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + --> $DIR/borrowck-box-insensitivity.rs:100:9 + | +LL | let _x = a.x.x; + | -- value moved here +99 | //~^ value moved here +LL | let _y = a.y; //~ ERROR use of collaterally moved + | ^^ value used here after move + | + = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of collaterally moved value: `a.y` - --> $DIR/borrowck-box-insensitivity.rs:108:9 - | -106 | let _x = a.x.x; - | -- value moved here -107 | //~^ value moved here -108 | let _y = a.y; //~ ERROR use of collaterally moved - | ^^ value used here after move - | - = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + --> $DIR/borrowck-box-insensitivity.rs:108:9 + | +LL | let _x = a.x.x; + | -- value moved here +107| //~^ value moved here +LL | let _y = a.y; //~ ERROR use of collaterally moved + | ^^ value used here after move + | + = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0382]: use of collaterally moved value: `a.y` - --> $DIR/borrowck-box-insensitivity.rs:116:15 - | -114 | let _x = a.x.x; - | -- value moved here -115 | //~^ value moved here -116 | let _y = &a.y; //~ ERROR use of collaterally moved - | ^^^ value used here after move - | - = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + --> $DIR/borrowck-box-insensitivity.rs:116:15 + | +LL | let _x = a.x.x; + | -- value moved here +115| //~^ value moved here +LL | let _y = &a.y; //~ ERROR use of collaterally moved + | ^^^ value used here after move + | + = note: move occurs because `a.x.x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait error[E0505]: cannot move out of `a.y` because it is borrowed - --> $DIR/borrowck-box-insensitivity.rs:124:9 - | -122 | let _x = &a.x.x; - | ----- borrow of `a.x.x` occurs here -123 | //~^ borrow of `a.x.x` occurs here -124 | let _y = a.y; - | ^^ move out of `a.y` occurs here + --> $DIR/borrowck-box-insensitivity.rs:124:9 + | +LL | let _x = &a.x.x; + | ----- borrow of `a.x.x` occurs here +123| //~^ borrow of `a.x.x` occurs here +LL | let _y = a.y; + | ^^ move out of `a.y` occurs here error[E0503]: cannot use `a.y` because it was mutably borrowed - --> $DIR/borrowck-box-insensitivity.rs:132:9 - | -131 | let _x = &mut a.x.x; - | ----- borrow of `a.x.x` occurs here -132 | let _y = a.y; //~ ERROR cannot use - | ^^ use of borrowed `a.x.x` + --> $DIR/borrowck-box-insensitivity.rs:132:9 + | +LL | let _x = &mut a.x.x; + | ----- borrow of `a.x.x` occurs here +LL | let _y = a.y; //~ ERROR cannot use + | ^^ use of borrowed `a.x.x` error[E0505]: cannot move out of `a.y` because it is borrowed - --> $DIR/borrowck-box-insensitivity.rs:138:9 - | -137 | let _x = &mut a.x.x; - | ----- borrow of `a.x.x` occurs here -138 | let _y = a.y; - | ^^ move out of `a.y` occurs here + --> $DIR/borrowck-box-insensitivity.rs:138:9 + | +LL | let _x = &mut a.x.x; + | ----- borrow of `a.x.x` occurs here +LL | let _y = a.y; + | ^^ move out of `a.y` occurs here error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed as mutable - --> $DIR/borrowck-box-insensitivity.rs:147:15 - | -145 | let _x = &mut a.x.x; - | ----- mutable borrow occurs here -146 | //~^ mutable borrow occurs here -147 | let _y = &a.y; //~ ERROR cannot borrow - | ^^^ immutable borrow occurs here -148 | //~^ immutable borrow occurs here -149 | } - | - mutable borrow ends here + --> $DIR/borrowck-box-insensitivity.rs:147:15 + | +LL | let _x = &mut a.x.x; + | ----- mutable borrow occurs here +146| //~^ mutable borrow occurs here +LL | let _y = &a.y; //~ ERROR cannot borrow + | ^^^ immutable borrow occurs here +148| //~^ immutable borrow occurs here +LL | } + | - mutable borrow ends here error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as immutable - --> $DIR/borrowck-box-insensitivity.rs:155:19 - | -153 | let _x = &a.x.x; - | ----- immutable borrow occurs here -154 | //~^ immutable borrow occurs here -155 | let _y = &mut a.y; //~ ERROR cannot borrow - | ^^^ mutable borrow occurs here -156 | //~^ mutable borrow occurs here -157 | } - | - immutable borrow ends here + --> $DIR/borrowck-box-insensitivity.rs:155:19 + | +LL | let _x = &a.x.x; + | ----- immutable borrow occurs here +154| //~^ immutable borrow occurs here +LL | let _y = &mut a.y; //~ ERROR cannot borrow + | ^^^ mutable borrow occurs here +156| //~^ mutable borrow occurs here +LL | } + | - immutable borrow ends here error: aborting due to 16 previous errors diff --git a/src/test/ui/borrowck/borrowck-closures-two-mut.stderr b/src/test/ui/borrowck/borrowck-closures-two-mut.stderr index a9d585e332e..92d788630ed 100644 --- a/src/test/ui/borrowck/borrowck-closures-two-mut.stderr +++ b/src/test/ui/borrowck/borrowck-closures-two-mut.stderr @@ -1,151 +1,151 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) --> $DIR/borrowck-closures-two-mut.rs:24:24 | -23 | let c1 = to_fn_mut(|| x = 4); +LL | let c1 = to_fn_mut(|| x = 4); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once +LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here 25 | //~| ERROR cannot borrow `x` as mutable more than once -26 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) --> $DIR/borrowck-closures-two-mut.rs:35:24 | -34 | let c1 = to_fn_mut(|| set(&mut x)); +LL | let c1 = to_fn_mut(|| set(&mut x)); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -35 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once +LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here 36 | //~| ERROR cannot borrow `x` as mutable more than once -37 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) --> $DIR/borrowck-closures-two-mut.rs:42:24 | -41 | let c1 = to_fn_mut(|| x = 5); +LL | let c1 = to_fn_mut(|| x = 5); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -42 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once +LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here 43 | //~| ERROR cannot borrow `x` as mutable more than once -44 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) --> $DIR/borrowck-closures-two-mut.rs:49:24 | -48 | let c1 = to_fn_mut(|| x = 5); +LL | let c1 = to_fn_mut(|| x = 5); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -49 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure) +LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure) | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here ... -52 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast) --> $DIR/borrowck-closures-two-mut.rs:61:24 | -60 | let c1 = to_fn_mut(|| set(&mut *x.f)); +LL | let c1 = to_fn_mut(|| set(&mut *x.f)); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -61 | let c2 = to_fn_mut(|| set(&mut *x.f)); +LL | let c2 = to_fn_mut(|| set(&mut *x.f)); | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here ... -64 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) --> $DIR/borrowck-closures-two-mut.rs:24:24 | -23 | let c1 = to_fn_mut(|| x = 4); +LL | let c1 = to_fn_mut(|| x = 4); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -24 | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once +LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here 25 | //~| ERROR cannot borrow `x` as mutable more than once -26 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) --> $DIR/borrowck-closures-two-mut.rs:35:24 | -34 | let c1 = to_fn_mut(|| set(&mut x)); +LL | let c1 = to_fn_mut(|| set(&mut x)); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -35 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once +LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here 36 | //~| ERROR cannot borrow `x` as mutable more than once -37 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) --> $DIR/borrowck-closures-two-mut.rs:42:24 | -41 | let c1 = to_fn_mut(|| x = 5); +LL | let c1 = to_fn_mut(|| x = 5); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -42 | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once +LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here 43 | //~| ERROR cannot borrow `x` as mutable more than once -44 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) --> $DIR/borrowck-closures-two-mut.rs:49:24 | -48 | let c1 = to_fn_mut(|| x = 5); +LL | let c1 = to_fn_mut(|| x = 5); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -49 | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure) +LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure) | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here ... -52 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time (Mir) --> $DIR/borrowck-closures-two-mut.rs:61:24 | -60 | let c1 = to_fn_mut(|| set(&mut *x.f)); +LL | let c1 = to_fn_mut(|| set(&mut *x.f)); | -- - previous borrow occurs due to use of `x` in closure | | | first mutable borrow occurs here -61 | let c2 = to_fn_mut(|| set(&mut *x.f)); +LL | let c2 = to_fn_mut(|| set(&mut *x.f)); | ^^ - borrow occurs due to use of `x` in closure | | | second mutable borrow occurs here ... -64 | } +LL | } | - first borrow ends here error: aborting due to 10 previous errors diff --git a/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr b/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr index 9dca165c022..b3db36cf2dd 100644 --- a/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr +++ b/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr @@ -1,7 +1,7 @@ error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function --> $DIR/borrowck-escaping-closure-error-1.rs:23:11 | -23 | spawn(|| books.push(4)); +LL | spawn(|| books.push(4)); | ^^ ----- `books` is borrowed here | | | may outlive borrowed value `books` diff --git a/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr b/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr index 6becf90214f..d5c7274dbf1 100644 --- a/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr +++ b/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr @@ -1,7 +1,7 @@ error[E0373]: closure may outlive the current function, but it borrows `books`, which is owned by the current function --> $DIR/borrowck-escaping-closure-error-2.rs:21:14 | -21 | Box::new(|| books.push(4)) +LL | Box::new(|| books.push(4)) | ^^ ----- `books` is borrowed here | | | may outlive borrowed value `books` diff --git a/src/test/ui/borrowck/borrowck-in-static.stderr b/src/test/ui/borrowck/borrowck-in-static.stderr index cafc608d794..989322662e8 100644 --- a/src/test/ui/borrowck/borrowck-in-static.stderr +++ b/src/test/ui/borrowck/borrowck-in-static.stderr @@ -1,9 +1,9 @@ error[E0507]: cannot move out of captured outer variable in an `Fn` closure --> $DIR/borrowck-in-static.rs:15:17 | -14 | let x = Box::new(0); +LL | let x = Box::new(0); | - captured outer variable -15 | Box::new(|| x) //~ ERROR cannot move out of captured outer variable +LL | Box::new(|| x) //~ ERROR cannot move out of captured outer variable | ^ cannot move out of captured outer variable in an `Fn` closure error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-move-error-with-note.stderr b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr index b4edd80bfe7..8b2e6c7f45a 100644 --- a/src/test/ui/borrowck/borrowck-move-error-with-note.stderr +++ b/src/test/ui/borrowck/borrowck-move-error-with-note.stderr @@ -1,35 +1,35 @@ error[E0507]: cannot move out of borrowed content --> $DIR/borrowck-move-error-with-note.rs:21:11 | -21 | match *f { //~ ERROR cannot move out of +LL | match *f { //~ ERROR cannot move out of | ^^ cannot move out of borrowed content 22 | //~| cannot move out -23 | Foo::Foo1(num1, +LL | Foo::Foo1(num1, | ---- hint: to prevent move, use `ref num1` or `ref mut num1` -24 | num2) => (), +LL | num2) => (), | ---- ...and here (use `ref num2` or `ref mut num2`) -25 | Foo::Foo2(num) => (), +LL | Foo::Foo2(num) => (), | --- ...and here (use `ref num` or `ref mut num`) error[E0509]: cannot move out of type `S`, which implements the `Drop` trait --> $DIR/borrowck-move-error-with-note.rs:40:9 | -40 | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait -41 | | //~| cannot move out of here -42 | | f: _s, +LL | / S { //~ ERROR cannot move out of type `S`, which implements the `Drop` trait +LL | | //~| cannot move out of here +LL | | f: _s, | | -- hint: to prevent move, use `ref _s` or `ref mut _s` -43 | | g: _t +LL | | g: _t | | -- ...and here (use `ref _t` or `ref mut _t`) -44 | | } => {} +LL | | } => {} | |_________^ cannot move out of here error[E0507]: cannot move out of borrowed content --> $DIR/borrowck-move-error-with-note.rs:57:11 | -57 | match a.a { //~ ERROR cannot move out of +LL | match a.a { //~ ERROR cannot move out of | ^ cannot move out of borrowed content 58 | //~| cannot move out -59 | n => { +LL | n => { | - hint: to prevent move, use `ref n` or `ref mut n` error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr index 2199c3ca45c..49d5daa543b 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr @@ -1,14 +1,14 @@ error[E0508]: cannot move out of type `[Foo]`, a non-copy slice --> $DIR/borrowck-move-out-of-vec-tail.rs:30:18 | -30 | &[Foo { string: a }, +LL | &[Foo { string: a }, | ^ - hint: to prevent move, use `ref a` or `ref mut a` | __________________| | | -31 | | //~^ ERROR cannot move out of type `[Foo]` -32 | | //~| cannot move out -33 | | //~| to prevent move -34 | | Foo { string: b }] => { +LL | | //~^ ERROR cannot move out of type `[Foo]` +LL | | //~| cannot move out +LL | | //~| to prevent move +LL | | Foo { string: b }] => { | |_________________________________-__^ cannot move out of here | | | ...and here (use `ref b` or `ref mut b`) diff --git a/src/test/ui/borrowck/borrowck-reinit.stderr b/src/test/ui/borrowck/borrowck-reinit.stderr index 4f212e7d79e..a2fbe5ab9cd 100644 --- a/src/test/ui/borrowck/borrowck-reinit.stderr +++ b/src/test/ui/borrowck/borrowck-reinit.stderr @@ -1,9 +1,9 @@ error[E0382]: use of moved value: `x` (Ast) --> $DIR/borrowck-reinit.rs:18:16 | -17 | drop(x); +LL | drop(x); | - value moved here -18 | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast) +LL | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast) | ^ value used here after move | = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait @@ -11,9 +11,9 @@ error[E0382]: use of moved value: `x` (Ast) error[E0382]: use of moved value: `x` (Mir) --> $DIR/borrowck-reinit.rs:18:16 | -17 | drop(x); +LL | drop(x); | - value moved here -18 | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast) +LL | let _ = (1,x); //~ ERROR use of moved value: `x` (Ast) | ^ value used here after move | = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr index 27e34fde244..583c273a2bf 100644 --- a/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr +++ b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr @@ -1,37 +1,37 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable --> $DIR/borrowck-report-with-custom-diagnostic.rs:17:14 | -15 | let y = &mut x; +LL | let y = &mut x; | - mutable borrow occurs here 16 | //~^ mutable borrow occurs here -17 | let z = &x; //~ ERROR cannot borrow +LL | let z = &x; //~ ERROR cannot borrow | ^ immutable borrow occurs here 18 | //~^ immutable borrow occurs here -19 | } +LL | } | - mutable borrow ends here error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable --> $DIR/borrowck-report-with-custom-diagnostic.rs:28:26 | -26 | let y = &x; +LL | let y = &x; | - immutable borrow occurs here 27 | //~^ immutable borrow occurs here -28 | let z = &mut x; //~ ERROR cannot borrow +LL | let z = &mut x; //~ ERROR cannot borrow | ^ mutable borrow occurs here 29 | //~^ mutable borrow occurs here -30 | } +LL | } | - immutable borrow ends here error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-report-with-custom-diagnostic.rs:41:22 | -39 | let y = &mut x; +LL | let y = &mut x; | - first mutable borrow occurs here 40 | //~^ first mutable borrow occurs here -41 | let z = &mut x; //~ ERROR cannot borrow +LL | let z = &mut x; //~ ERROR cannot borrow | ^ second mutable borrow occurs here 42 | //~^ second mutable borrow occurs here -43 | }; +LL | }; | - first borrow ends here error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr index 2c3509e9902..82d22ee4e66 100644 --- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr +++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr @@ -1,38 +1,38 @@ error[E0506]: cannot assign to `vec[..]` because it is borrowed --> $DIR/borrowck-vec-pattern-nesting.rs:21:13 | -19 | [box ref _a, _, _] => { +LL | [box ref _a, _, _] => { | ------ borrow of `vec[..]` occurs here 20 | //~^ borrow of `vec[..]` occurs here -21 | vec[0] = box 4; //~ ERROR cannot assign +LL | vec[0] = box 4; //~ ERROR cannot assign | ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here error[E0506]: cannot assign to `vec[..]` because it is borrowed --> $DIR/borrowck-vec-pattern-nesting.rs:33:13 | -31 | &mut [ref _b..] => { +LL | &mut [ref _b..] => { | ------ borrow of `vec[..]` occurs here 32 | //~^ borrow of `vec[..]` occurs here -33 | vec[0] = box 4; //~ ERROR cannot assign +LL | vec[0] = box 4; //~ ERROR cannot assign | ^^^^^^^^^^^^^^ assignment to borrowed `vec[..]` occurs here error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice --> $DIR/borrowck-vec-pattern-nesting.rs:43:14 | -43 | &mut [_a, //~ ERROR cannot move out +LL | &mut [_a, //~ ERROR cannot move out | ^-- hint: to prevent move, use `ref _a` or `ref mut _a` | ______________| | | -44 | | //~| cannot move out -45 | | //~| to prevent move -46 | | .. -47 | | ] => { +LL | | //~| cannot move out +LL | | //~| to prevent move +LL | | .. +LL | | ] => { | |_________^ cannot move out of here error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice --> $DIR/borrowck-vec-pattern-nesting.rs:56:13 | -56 | let a = vec[0]; //~ ERROR cannot move out +LL | let a = vec[0]; //~ ERROR cannot move out | ^^^^^^ | | | cannot move out of here @@ -41,10 +41,10 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice --> $DIR/borrowck-vec-pattern-nesting.rs:64:14 | -64 | &mut [ //~ ERROR cannot move out +LL | &mut [ //~ ERROR cannot move out | ______________^ -65 | | //~^ cannot move out -66 | | _b] => {} +LL | | //~^ cannot move out +LL | | _b] => {} | |__________--^ cannot move out of here | | | hint: to prevent move, use `ref _b` or `ref mut _b` @@ -52,7 +52,7 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice --> $DIR/borrowck-vec-pattern-nesting.rs:69:13 | -69 | let a = vec[0]; //~ ERROR cannot move out +LL | let a = vec[0]; //~ ERROR cannot move out | ^^^^^^ | | | cannot move out of here @@ -61,7 +61,7 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice --> $DIR/borrowck-vec-pattern-nesting.rs:77:14 | -77 | &mut [_a, _b, _c] => {} //~ ERROR cannot move out +LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out | ^--^^--^^--^ | || | | | || | ...and here (use `ref _c` or `ref mut _c`) @@ -72,7 +72,7 @@ error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy sli error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice --> $DIR/borrowck-vec-pattern-nesting.rs:81:13 | -81 | let a = vec[0]; //~ ERROR cannot move out +LL | let a = vec[0]; //~ ERROR cannot move out | ^^^^^^ | | | cannot move out of here diff --git a/src/test/ui/borrowck/immutable-arg.stderr b/src/test/ui/borrowck/immutable-arg.stderr index 68aeae30e71..34de3ca19a3 100644 --- a/src/test/ui/borrowck/immutable-arg.stderr +++ b/src/test/ui/borrowck/immutable-arg.stderr @@ -1,17 +1,17 @@ error[E0384]: cannot assign twice to immutable variable `_x` (Ast) --> $DIR/immutable-arg.rs:14:5 | -13 | fn foo(_x: u32) { +LL | fn foo(_x: u32) { | -- first assignment to `_x` -14 | _x = 4; +LL | _x = 4; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign to immutable argument `_x` (Mir) --> $DIR/immutable-arg.rs:14:5 | -13 | fn foo(_x: u32) { +LL | fn foo(_x: u32) { | -- argument not declared as `mut` -14 | _x = 4; +LL | _x = 4; | ^^^^^^ cannot assign to immutable argument error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/issue-41962.stderr b/src/test/ui/borrowck/issue-41962.stderr index 377171510c9..cf1d46b777a 100644 --- a/src/test/ui/borrowck/issue-41962.stderr +++ b/src/test/ui/borrowck/issue-41962.stderr @@ -1,7 +1,7 @@ error[E0382]: use of partially moved value: `maybe` (Ast) --> $DIR/issue-41962.rs:17:30 | -17 | if let Some(thing) = maybe { +LL | if let Some(thing) = maybe { | ----- ^^^^^ value used here after move | | | value moved here @@ -11,7 +11,7 @@ error[E0382]: use of partially moved value: `maybe` (Ast) error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) --> $DIR/issue-41962.rs:17:21 | -17 | if let Some(thing) = maybe { +LL | if let Some(thing) = maybe { | ^^^^^ value moved here in previous iteration of loop | = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait @@ -19,16 +19,16 @@ error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) error[E0382]: use of moved value: `maybe` (Mir) --> $DIR/issue-41962.rs:17:9 | -17 | if let Some(thing) = maybe { +LL | if let Some(thing) = maybe { | ^ ----- value moved here | _________| | | -18 | | //~^ ERROR use of partially moved value: `maybe` (Ast) [E0382] -19 | | //~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382] -20 | | //~| ERROR use of moved value: `maybe` (Mir) [E0382] +LL | | //~^ ERROR use of partially moved value: `maybe` (Ast) [E0382] +LL | | //~| ERROR use of moved value: `(maybe as std::prelude::v1::Some).0` (Ast) [E0382] +LL | | //~| ERROR use of moved value: `maybe` (Mir) [E0382] 21 | | //~| ERROR use of moved value: `maybe` (Mir) [E0382] -22 | | //~| ERROR use of moved value: `maybe.0` (Mir) [E0382] -23 | | } +LL | | //~| ERROR use of moved value: `maybe.0` (Mir) [E0382] +LL | | } | |_________^ value used here after move | = note: move occurs because `maybe` has type `std::option::Option<std::vec::Vec<bool>>`, which does not implement the `Copy` trait @@ -36,7 +36,7 @@ error[E0382]: use of moved value: `maybe` (Mir) error[E0382]: use of moved value: `maybe` (Mir) --> $DIR/issue-41962.rs:17:16 | -17 | if let Some(thing) = maybe { +LL | if let Some(thing) = maybe { | ^^^^^-----^ | | | | | value moved here @@ -47,7 +47,7 @@ error[E0382]: use of moved value: `maybe` (Mir) error[E0382]: use of moved value: `maybe.0` (Mir) --> $DIR/issue-41962.rs:17:21 | -17 | if let Some(thing) = maybe { +LL | if let Some(thing) = maybe { | ^^^^^ value moved here in previous iteration of loop | = note: move occurs because `maybe.0` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/issue-45983.stderr b/src/test/ui/borrowck/issue-45983.stderr index 496f15c289c..7625b9e7618 100644 --- a/src/test/ui/borrowck/issue-45983.stderr +++ b/src/test/ui/borrowck/issue-45983.stderr @@ -1,9 +1,9 @@ error: borrowed data cannot be stored outside of its closure --> $DIR/issue-45983.rs:17:27 | -16 | let x = None; +LL | let x = None; | - borrowed data cannot be stored into here... -17 | give_any(|y| x = Some(y)); +LL | give_any(|y| x = Some(y)); | --- ^ cannot be stored outside of its closure | | | ...because it cannot outlive this closure diff --git a/src/test/ui/borrowck/issue-7573.stderr b/src/test/ui/borrowck/issue-7573.stderr index 99b48d9276c..1f773e8ca2a 100644 --- a/src/test/ui/borrowck/issue-7573.stderr +++ b/src/test/ui/borrowck/issue-7573.stderr @@ -1,15 +1,15 @@ error: borrowed data cannot be stored outside of its closure --> $DIR/issue-7573.rs:32:27 | -27 | let mut lines_to_use: Vec<&CrateId> = Vec::new(); +LL | let mut lines_to_use: Vec<&CrateId> = Vec::new(); | - cannot infer an appropriate lifetime... 28 | //~^ NOTE cannot infer an appropriate lifetime -29 | let push_id = |installed_id: &CrateId| { +LL | let push_id = |installed_id: &CrateId| { | ------- ------------------------ borrowed data cannot outlive this closure | | | ...so that variable is valid at time of its declaration ... -32 | lines_to_use.push(installed_id); +LL | lines_to_use.push(installed_id); | ^^^^^^^^^^^^ cannot be stored outside of its closure error: aborting due to previous error diff --git a/src/test/ui/borrowck/mut-borrow-in-loop.stderr b/src/test/ui/borrowck/mut-borrow-in-loop.stderr index 755765a0383..aa75382e319 100644 --- a/src/test/ui/borrowck/mut-borrow-in-loop.stderr +++ b/src/test/ui/borrowck/mut-borrow-in-loop.stderr @@ -1,28 +1,28 @@ error[E0499]: cannot borrow `*arg` as mutable more than once at a time --> $DIR/mut-borrow-in-loop.rs:20:25 | -20 | (self.func)(arg) //~ ERROR cannot borrow +LL | (self.func)(arg) //~ ERROR cannot borrow | ^^^ mutable borrow starts here in previous iteration of loop 21 | } -22 | } +LL | } | - mutable borrow ends here error[E0499]: cannot borrow `*arg` as mutable more than once at a time --> $DIR/mut-borrow-in-loop.rs:26:25 | -26 | (self.func)(arg) //~ ERROR cannot borrow +LL | (self.func)(arg) //~ ERROR cannot borrow | ^^^ mutable borrow starts here in previous iteration of loop 27 | } -28 | } +LL | } | - mutable borrow ends here error[E0499]: cannot borrow `*arg` as mutable more than once at a time --> $DIR/mut-borrow-in-loop.rs:33:25 | -33 | (self.func)(arg) //~ ERROR cannot borrow +LL | (self.func)(arg) //~ ERROR cannot borrow | ^^^ mutable borrow starts here in previous iteration of loop 34 | } -35 | } +LL | } | - mutable borrow ends here error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/mut-borrow-outside-loop.stderr b/src/test/ui/borrowck/mut-borrow-outside-loop.stderr index 2064129ab74..583f97b6cdf 100644 --- a/src/test/ui/borrowck/mut-borrow-outside-loop.stderr +++ b/src/test/ui/borrowck/mut-borrow-outside-loop.stderr @@ -1,22 +1,22 @@ error[E0499]: cannot borrow `void` as mutable more than once at a time --> $DIR/mut-borrow-outside-loop.rs:17:23 | -16 | let first = &mut void; +LL | let first = &mut void; | ---- first mutable borrow occurs here -17 | let second = &mut void; //~ ERROR cannot borrow +LL | let second = &mut void; //~ ERROR cannot borrow | ^^^^ second mutable borrow occurs here ... -25 | } +LL | } | - first borrow ends here error[E0499]: cannot borrow `inner_void` as mutable more than once at a time --> $DIR/mut-borrow-outside-loop.rs:23:33 | -22 | let inner_first = &mut inner_void; +LL | let inner_first = &mut inner_void; | ---------- first mutable borrow occurs here -23 | let inner_second = &mut inner_void; //~ ERROR cannot borrow +LL | let inner_second = &mut inner_void; //~ ERROR cannot borrow | ^^^^^^^^^^ second mutable borrow occurs here -24 | } +LL | } | - first borrow ends here error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr index 435640769dd..2fe3a45b76d 100644 --- a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr +++ b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr @@ -1,25 +1,25 @@ error[E0195]: lifetime parameters or bounds on method `no_bound` do not match the trait declaration --> $DIR/regions-bound-missing-bound-in-impl.rs:28:5 | -20 | fn no_bound<'b>(self, b: Inv<'b>); +LL | fn no_bound<'b>(self, b: Inv<'b>); | ---------------------------------- lifetimes in impl do not match this method in trait ... -28 | fn no_bound<'b:'a>(self, b: Inv<'b>) { +LL | fn no_bound<'b:'a>(self, b: Inv<'b>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait error[E0195]: lifetime parameters or bounds on method `has_bound` do not match the trait declaration --> $DIR/regions-bound-missing-bound-in-impl.rs:32:5 | -21 | fn has_bound<'b:'a>(self, b: Inv<'b>); +LL | fn has_bound<'b:'a>(self, b: Inv<'b>); | -------------------------------------- lifetimes in impl do not match this method in trait ... -32 | fn has_bound<'b>(self, b: Inv<'b>) { +LL | fn has_bound<'b>(self, b: Inv<'b>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetimes do not match method in trait error[E0308]: method not compatible with trait --> $DIR/regions-bound-missing-bound-in-impl.rs:36:5 | -36 | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { +LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | = note: expected type `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)` @@ -27,21 +27,21 @@ error[E0308]: method not compatible with trait note: the lifetime 'c as defined on the method body at 36:5... --> $DIR/regions-bound-missing-bound-in-impl.rs:36:5 | -36 | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { +LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...does not necessarily outlive the lifetime 'c as defined on the method body at 36:5 --> $DIR/regions-bound-missing-bound-in-impl.rs:36:5 | -36 | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { +LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0276]: impl has stricter requirements than trait --> $DIR/regions-bound-missing-bound-in-impl.rs:53:5 | -24 | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>); +LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>); | ------------------------------------------------------- definition of `another_bound` from trait ... -53 | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) { +LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'x: 't` error: aborting due to 4 previous errors diff --git a/src/test/ui/borrowck/regions-escape-bound-fn-2.stderr b/src/test/ui/borrowck/regions-escape-bound-fn-2.stderr index 3d88f4fd52e..05654a93564 100644 --- a/src/test/ui/borrowck/regions-escape-bound-fn-2.stderr +++ b/src/test/ui/borrowck/regions-escape-bound-fn-2.stderr @@ -1,9 +1,9 @@ error: borrowed data cannot be stored outside of its closure --> $DIR/regions-escape-bound-fn-2.rs:18:27 | -17 | let mut x = None; +LL | let mut x = None; | ----- borrowed data cannot be stored into here... -18 | with_int(|y| x = Some(y)); +LL | with_int(|y| x = Some(y)); | --- ^ cannot be stored outside of its closure | | | ...because it cannot outlive this closure diff --git a/src/test/ui/borrowck/regions-escape-bound-fn.stderr b/src/test/ui/borrowck/regions-escape-bound-fn.stderr index a2ad7c3f768..5f05ee90d07 100644 --- a/src/test/ui/borrowck/regions-escape-bound-fn.stderr +++ b/src/test/ui/borrowck/regions-escape-bound-fn.stderr @@ -1,9 +1,9 @@ error: borrowed data cannot be stored outside of its closure --> $DIR/regions-escape-bound-fn.rs:18:27 | -17 | let mut x: Option<&isize> = None; +LL | let mut x: Option<&isize> = None; | ----- borrowed data cannot be stored into here... -18 | with_int(|y| x = Some(y)); +LL | with_int(|y| x = Some(y)); | --- ^ cannot be stored outside of its closure | | | ...because it cannot outlive this closure diff --git a/src/test/ui/borrowck/regions-escape-unboxed-closure.stderr b/src/test/ui/borrowck/regions-escape-unboxed-closure.stderr index 4b01e42fa67..c90dd2417d0 100644 --- a/src/test/ui/borrowck/regions-escape-unboxed-closure.stderr +++ b/src/test/ui/borrowck/regions-escape-unboxed-closure.stderr @@ -1,9 +1,9 @@ error: borrowed data cannot be stored outside of its closure --> $DIR/regions-escape-unboxed-closure.rs:16:32 | -15 | let mut x: Option<&isize> = None; +LL | let mut x: Option<&isize> = None; | ----- borrowed data cannot be stored into here... -16 | with_int(&mut |y| x = Some(y)); +LL | with_int(&mut |y| x = Some(y)); | --- ^ cannot be stored outside of its closure | | | ...because it cannot outlive this closure diff --git a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr index 69f4742424b..0b66fd00488 100644 --- a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr +++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr @@ -1,10 +1,10 @@ error[E0507]: cannot move out of captured outer variable in an `Fn` closure --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9 | -19 | let y = vec![format!("World")]; +LL | let y = vec![format!("World")]; | - captured outer variable 20 | call(|| { -21 | y.into_iter(); +LL | y.into_iter(); | ^ cannot move out of captured outer variable in an `Fn` closure error: aborting due to previous error |
