Skip to content

Blindly checkpoint status of NLL mode ui tests #49861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/test/ui/augmented-assignments.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/augmented-assignments.rs:26:5
|
LL | x //~ error: use of moved value: `x`
| -
| |
| _____borrow of `x` occurs here
| |
LL | | //~^ value used here after move
LL | | +=
LL | | x; //~ value moved here
| | -
| | |
| |_____move out of `x` occurs here
| borrow later used here

error[E0596]: cannot borrow immutable item `y` as mutable
--> $DIR/augmented-assignments.rs:30:5
|
LL | y //~ error: cannot borrow immutable local variable `y` as mutable
| ^ cannot borrow as mutable

error: aborting due to 2 previous errors

Some errors occurred: E0505, E0596.
For more information about an error, try `rustc --explain E0505`.
25 changes: 25 additions & 0 deletions src/test/ui/borrowck/borrowck-box-insensitivity.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
error[E0382]: use of moved value: `a.y`
--> $DIR/borrowck-box-insensitivity.rs:46:14
|
LL | let _x = a.x;
| --- value moved here
LL | //~^ value moved here
LL | let _y = a.y; //~ ERROR use of moved
| ^^^ value used here after move
|
= note: move occurs because `a.y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `a.y`
--> $DIR/borrowck-box-insensitivity.rs:108:14
|
LL | let _x = a.x.x;
| ----- value moved here
LL | //~^ value moved here
LL | let _y = a.y; //~ ERROR use of collaterally moved
| ^^^ value used here after move
|
= note: move occurs because `a.y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0382`.
78 changes: 78 additions & 0 deletions src/test/ui/borrowck/borrowck-closures-two-mut.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
--> $DIR/borrowck-closures-two-mut.rs:24:24
|
LL | let c1 = to_fn_mut(|| x = 4);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
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
LL | //~| ERROR cannot borrow `x` as mutable more than once
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
|
LL | let c1 = to_fn_mut(|| set(&mut x));
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
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
LL | //~| ERROR cannot borrow `x` as mutable more than once
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
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
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
LL | //~| ERROR cannot borrow `x` as mutable more than once
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
|
LL | let c1 = to_fn_mut(|| x = 5);
| -- - previous borrow occurs due to use of `x` in closure
| |
| first mutable borrow occurs here
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
...
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
|
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
LL | let c2 = to_fn_mut(|| set(&mut *x.f));
| ^^ - borrow occurs due to use of `x` in closure
| |
| second mutable borrow occurs here
...
LL | }
| - first borrow ends here

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0499`.
14 changes: 14 additions & 0 deletions src/test/ui/borrowck/borrowck-escaping-closure-error-1.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0597]: `books` does not live long enough
--> $DIR/borrowck-escaping-closure-error-1.rs:23:11
|
LL | spawn(|| books.push(4));
| ^^^^^^^^^^^^^^^^ borrowed value does not live long enough
LL | //~^ ERROR E0373
LL | }
| - borrowed value only lives until here
|
= note: borrowed value must be valid for the static lifetime...

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
18 changes: 18 additions & 0 deletions src/test/ui/borrowck/borrowck-escaping-closure-error-2.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0597]: `books` does not live long enough
--> $DIR/borrowck-escaping-closure-error-2.rs:21:14
|
LL | Box::new(|| books.push(4))
| ^^^^^^^^^^^^^^^^ borrowed value does not live long enough
LL | //~^ ERROR E0373
LL | }
| - borrowed value only lives until here
|
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 19:1...
--> $DIR/borrowck-escaping-closure-error-2.rs:19:1
|
LL | fn foo<'a>(x: &'a i32) -> Box<FnMut()+'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0597`.
9 changes: 9 additions & 0 deletions src/test/ui/borrowck/borrowck-in-static.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-in-static.rs:15:17
|
LL | Box::new(|| x) //~ ERROR cannot move out of captured outer variable
| ^ cannot move out of borrowed content

error: aborting due to previous error

For more information about this error, try `rustc --explain E0507`.
40 changes: 40 additions & 0 deletions src/test/ui/borrowck/borrowck-move-error-with-note.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-error-with-note.rs:23:19
|
LL | Foo::Foo1(num1,
| ^^^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-error-with-note.rs:24:19
|
LL | num2) => (),
| ^^^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-error-with-note.rs:25:19
|
LL | Foo::Foo2(num) => (),
| ^^^ cannot move out of borrowed content

error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
--> $DIR/borrowck-move-error-with-note.rs:42:16
|
LL | f: _s,
| ^^ cannot move out of here

error[E0509]: cannot move out of type `S`, which implements the `Drop` trait
--> $DIR/borrowck-move-error-with-note.rs:43:16
|
LL | g: _t
| ^^ cannot move out of here

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-error-with-note.rs:59:9
|
LL | n => {
| ^ cannot move out of borrowed content

error: aborting due to 6 previous errors

Some errors occurred: E0507, E0509.
For more information about an error, try `rustc --explain E0507`.
15 changes: 15 additions & 0 deletions src/test/ui/borrowck/borrowck-move-out-of-vec-tail.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-out-of-vec-tail.rs:30:33
|
LL | &[Foo { string: a },
| ^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-move-out-of-vec-tail.rs:34:33
|
LL | Foo { string: b }] => {
| ^ cannot move out of borrowed content

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0507`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: compilation successful
--> $DIR/borrowck-report-with-custom-diagnostic.rs:12:1
|
LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
LL | | // Original borrow ends at end of function
LL | | let mut x = 1;
LL | | let y = &mut x;
... |
LL | | //~^ immutable borrow occurs here
LL | | }
| |_^

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// <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.

#![feature(rustc_attrs)]
#![allow(dead_code)]
fn main() {
fn main() { #![rustc_error] // rust-lang/rust#49855
// Original borrow ends at end of function
let mut x = 1;
let y = &mut x;
Expand Down
51 changes: 51 additions & 0 deletions src/test/ui/borrowck/borrowck-vec-pattern-nesting.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:42:15
|
LL | &mut [_a, //~ ERROR cannot move out
| ^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:55:13
|
LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:65:10
|
LL | _b] => {}
| ^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:68:13
|
LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:76:15
|
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
| ^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:76:19
|
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
| ^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:76:23
|
LL | &mut [_a, _b, _c] => {} //~ ERROR cannot move out
| ^^ cannot move out of borrowed content

error[E0507]: cannot move out of borrowed content
--> $DIR/borrowck-vec-pattern-nesting.rs:80:13
|
LL | let a = vec[0]; //~ ERROR cannot move out
| ^^^^^^ cannot move out of borrowed content

error: aborting due to 8 previous errors

For more information about this error, try `rustc --explain E0507`.
30 changes: 30 additions & 0 deletions src/test/ui/borrowck/issue-45983.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
warning: not reporting region error due to -Znll
--> $DIR/issue-45983.rs:17:27
|
LL | give_any(|y| x = Some(y));
| ^

error: free region `` does not outlive free region `'_#2r`
--> $DIR/issue-45983.rs:17:27
|
LL | give_any(|y| x = Some(y));
| ^

error[E0594]: cannot assign to immutable item `x`
--> $DIR/issue-45983.rs:17:18
|
LL | give_any(|y| x = Some(y));
| ^^^^^^^^^^^ cannot mutate
|
= note: Value not mutable causing this error: `x`

error[E0596]: cannot borrow immutable item `x` as mutable
--> $DIR/issue-45983.rs:17:14
|
LL | give_any(|y| x = Some(y));
| ^^^^^^^^^^^^^^^ cannot borrow as mutable

error: aborting due to 3 previous errors

Some errors occurred: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.
14 changes: 14 additions & 0 deletions src/test/ui/borrowck/issue-7573.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
warning: not reporting region error due to -Znll
--> $DIR/issue-7573.rs:27:31
|
LL | let mut lines_to_use: Vec<&CrateId> = Vec::new();
| ^

error: free region `` does not outlive free region `'_#2r`
--> $DIR/issue-7573.rs:32:9
|
LL | lines_to_use.push(installed_id);
| ^^^^^^^^^^^^

error: aborting due to previous error

21 changes: 21 additions & 0 deletions src/test/ui/borrowck/mut-borrow-in-loop.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0499]: cannot borrow `*arg` as mutable more than once at a time
--> $DIR/mut-borrow-in-loop.rs:20:25
|
LL | (self.func)(arg) //~ ERROR cannot borrow
| ^^^ mutable borrow starts here in previous iteration of loop

error[E0499]: cannot borrow `*arg` as mutable more than once at a time
--> $DIR/mut-borrow-in-loop.rs:26:25
|
LL | (self.func)(arg) //~ ERROR cannot borrow
| ^^^ mutable borrow starts here in previous iteration of loop

error[E0499]: cannot borrow `*arg` as mutable more than once at a time
--> $DIR/mut-borrow-in-loop.rs:33:25
|
LL | (self.func)(arg) //~ ERROR cannot borrow
| ^^^ mutable borrow starts here in previous iteration of loop

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0499`.
14 changes: 14 additions & 0 deletions src/test/ui/borrowck/mut-borrow-outside-loop.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: compilation successful
--> $DIR/mut-borrow-outside-loop.rs:13:1
|
LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
LL | | let mut void = ();
LL | |
LL | | let first = &mut void;
... |
LL | | }
LL | | }
| |_^

error: aborting due to previous error

Loading