Skip to content

Commit b391b32

Browse files
committed
Use revisions for NLL in issues
1 parent b7c192e commit b391b32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+159
-78
lines changed

src/test/ui/issues/issue-10291.stderr renamed to src/test/ui/issues/issue-10291.base.stderr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
error[E0312]: lifetime of reference outlives lifetime of borrowed content...
2-
--> $DIR/issue-10291.rs:3:9
2+
--> $DIR/issue-10291.rs:7:9
33
|
44
LL | x
55
| ^
66
|
77
note: ...the reference is valid for the anonymous lifetime #1 defined here...
8-
--> $DIR/issue-10291.rs:2:69
8+
--> $DIR/issue-10291.rs:6:69
99
|
1010
LL | drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
1111
| _____________________________________________________________________^
1212
LL | | x
13+
LL | |
14+
LL | |
1315
LL | | }));
1416
| |_____^
1517
note: ...but the borrowed content is only valid for the lifetime `'x` as defined here
16-
--> $DIR/issue-10291.rs:1:9
18+
--> $DIR/issue-10291.rs:5:9
1719
|
1820
LL | fn test<'x>(x: &'x isize) {
1921
| ^^

src/test/ui/issues/issue-10291.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-10291.rs:3:9
2+
--> $DIR/issue-10291.rs:7:9
33
|
44
LL | fn test<'x>(x: &'x isize) {
55
| -- lifetime `'x` defined here

src/test/ui/issues/issue-10291.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
fn test<'x>(x: &'x isize) {
26
drop::<Box<dyn for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
3-
x //~ ERROR E0312
7+
x
8+
//[base]~^ ERROR E0312
9+
//[nll]~^^ ERROR lifetime may not live long enough
410
}));
511
}
612

src/test/ui/issues/issue-13058.stderr renamed to src/test/ui/issues/issue-13058.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0621]: explicit lifetime required in the type of `cont`
2-
--> $DIR/issue-13058.rs:14:26
2+
--> $DIR/issue-13058.rs:18:26
33
|
44
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
55
| -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`

src/test/ui/issues/issue-13058.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0621]: explicit lifetime required in the type of `cont`
2-
--> $DIR/issue-13058.rs:14:21
2+
--> $DIR/issue-13058.rs:18:21
33
|
44
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
55
| -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`

src/test/ui/issues/issue-13058.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
use std::ops::Range;
26

37
trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; }

src/test/ui/issues/issue-15034.stderr renamed to src/test/ui/issues/issue-15034.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0621]: explicit lifetime required in the type of `lexer`
2-
--> $DIR/issue-15034.rs:17:25
2+
--> $DIR/issue-15034.rs:21:25
33
|
44
LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
55
| ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`

src/test/ui/issues/issue-15034.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0621]: explicit lifetime required in the type of `lexer`
2-
--> $DIR/issue-15034.rs:17:9
2+
--> $DIR/issue-15034.rs:21:9
33
|
44
LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
55
| ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`

src/test/ui/issues/issue-15034.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
pub struct Lexer<'a> {
26
input: &'a str,
37
}

src/test/ui/issues/issue-16683.stderr renamed to src/test/ui/issues/issue-16683.base.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
2-
--> $DIR/issue-16683.rs:4:14
2+
--> $DIR/issue-16683.rs:8:14
33
|
44
LL | self.a();
55
| ^
66
|
77
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
8-
--> $DIR/issue-16683.rs:3:10
8+
--> $DIR/issue-16683.rs:7:10
99
|
1010
LL | fn b(&self) {
1111
| ^^^^^
1212
note: ...so that reference does not outlive borrowed content
13-
--> $DIR/issue-16683.rs:4:9
13+
--> $DIR/issue-16683.rs:8:9
1414
|
1515
LL | self.a();
1616
| ^^^^
1717
note: but, the lifetime must be valid for the lifetime `'a` as defined here...
18-
--> $DIR/issue-16683.rs:1:9
18+
--> $DIR/issue-16683.rs:5:9
1919
|
2020
LL | trait T<'a> {
2121
| ^^
2222
note: ...so that the types are compatible
23-
--> $DIR/issue-16683.rs:4:14
23+
--> $DIR/issue-16683.rs:8:14
2424
|
2525
LL | self.a();
2626
| ^

src/test/ui/issues/issue-16683.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-16683.rs:4:9
2+
--> $DIR/issue-16683.rs:8:9
33
|
44
LL | trait T<'a> {
55
| -- lifetime `'a` defined here

src/test/ui/issues/issue-16683.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
trait T<'a> {
26
fn a(&'a self) -> &'a bool;
37
fn b(&self) {
4-
self.a(); //~ ERROR cannot infer
8+
self.a();
9+
//[base]~^ ERROR cannot infer
10+
//[nll]~^^ ERROR lifetime may not live long enough
511
}
612
}
713

src/test/ui/issues/issue-16922.stderr renamed to src/test/ui/issues/issue-16922.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0759]: `value` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
2-
--> $DIR/issue-16922.rs:4:14
2+
--> $DIR/issue-16922.rs:8:14
33
|
44
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
55
| -- this data with an anonymous lifetime `'_`...

src/test/ui/issues/issue-16922.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-16922.rs:4:5
2+
--> $DIR/issue-16922.rs:8:5
33
|
44
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
55
| - let's call the lifetime of this reference `'1`

src/test/ui/issues/issue-16922.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
use std::any::Any;
26

37
fn foo<T: Any>(value: &T) -> Box<dyn Any> {
4-
Box::new(value) as Box<dyn Any> //~ ERROR E0759
8+
Box::new(value) as Box<dyn Any>
9+
//[base]~^ ERROR E0759
10+
//[nll]~^^ ERROR lifetime may not live long enough
511
}
612

713
fn main() {

src/test/ui/issues/issue-17728.stderr renamed to src/test/ui/issues/issue-17728.base.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0623]: lifetime mismatch
2-
--> $DIR/issue-17728.rs:15:28
2+
--> $DIR/issue-17728.rs:19:28
33
|
44
LL | fn attemptTraverse(&self, room: &Room, directionStr: &str) -> Result<&Room, &str> {
55
| ----- -------------------
@@ -16,7 +16,7 @@ LL | fn attemptTraverse<'a>(&'a self, room: &'a Room, directionStr: &str) ->
1616
| ++++ ++ ++
1717

1818
error[E0308]: `match` arms have incompatible types
19-
--> $DIR/issue-17728.rs:109:14
19+
--> $DIR/issue-17728.rs:113:14
2020
|
2121
LL | / match to_parse {
2222
LL | | "w" | "west" => RoomDirection::West,

src/test/ui/issues/issue-17728.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: `match` arms have incompatible types
2-
--> $DIR/issue-17728.rs:109:14
2+
--> $DIR/issue-17728.rs:113:14
33
|
44
LL | / match to_parse {
55
LL | | "w" | "west" => RoomDirection::West,

src/test/ui/issues/issue-17728.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
use std::fmt::{Debug, Formatter, Error};
26
use std::collections::HashMap;
37

@@ -13,7 +17,7 @@ trait TraversesWorld {
1317
let maybe_room = room.direction_to_room.get(&direction);
1418
match maybe_room {
1519
Some(entry) => Ok(entry),
16-
//~^ ERROR lifetime mismatch [E0623]
20+
//[base]~^ ERROR lifetime mismatch [E0623]
1721
_ => Err("Direction does not exist in room.")
1822
}
1923
}

src/test/ui/issues/issue-17758.stderr renamed to src/test/ui/issues/issue-17758.base.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements
2-
--> $DIR/issue-17758.rs:7:14
2+
--> $DIR/issue-17758.rs:11:14
33
|
44
LL | self.foo();
55
| ^^^
66
|
77
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
8-
--> $DIR/issue-17758.rs:6:12
8+
--> $DIR/issue-17758.rs:10:12
99
|
1010
LL | fn bar(&self) {
1111
| ^^^^^
1212
note: ...so that reference does not outlive borrowed content
13-
--> $DIR/issue-17758.rs:7:9
13+
--> $DIR/issue-17758.rs:11:9
1414
|
1515
LL | self.foo();
1616
| ^^^^
1717
note: but, the lifetime must be valid for the lifetime `'a` as defined here...
18-
--> $DIR/issue-17758.rs:4:11
18+
--> $DIR/issue-17758.rs:8:11
1919
|
2020
LL | trait Foo<'a> {
2121
| ^^
2222
note: ...so that the types are compatible
23-
--> $DIR/issue-17758.rs:7:14
23+
--> $DIR/issue-17758.rs:11:14
2424
|
2525
LL | self.foo();
2626
| ^^^

src/test/ui/issues/issue-17758.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-17758.rs:7:9
2+
--> $DIR/issue-17758.rs:11:9
33
|
44
LL | trait Foo<'a> {
55
| -- lifetime `'a` defined here

src/test/ui/issues/issue-17758.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
// Test that regionck suggestions in a provided method of a trait
26
// don't ICE
37

48
trait Foo<'a> {
59
fn foo(&'a self);
610
fn bar(&self) {
711
self.foo();
8-
//~^ ERROR cannot infer
12+
//[base]~^ ERROR cannot infer
13+
//[nll]~^^ ERROR lifetime may not live long enough
914
}
1015
}
1116

src/test/ui/issues/issue-26217.stderr renamed to src/test/ui/issues/issue-26217.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0477]: the type `&'a i32` does not fulfill the required lifetime
2-
--> $DIR/issue-26217.rs:4:5
2+
--> $DIR/issue-26217.rs:8:5
33
|
44
LL | foo::<&'a i32>();
55
| ^^^^^^^^^^^^^^

src/test/ui/issues/issue-26217.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-26217.rs:4:5
2+
--> $DIR/issue-26217.rs:8:5
33
|
44
LL | fn bar<'a>() {
55
| -- lifetime `'a` defined here

src/test/ui/issues/issue-26217.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
fn foo<T>() where for<'a> T: 'a {}
26

37
fn bar<'a>() {
48
foo::<&'a i32>();
5-
//~^ ERROR the type `&'a i32` does not fulfill the required lifetime
9+
//[base]~^ ERROR the type `&'a i32` does not fulfill the required lifetime
10+
//[nll]~^^ ERROR lifetime may not live long enough
611
}
712

813
fn main() {

src/test/ui/issues/issue-40000.stderr renamed to src/test/ui/issues/issue-40000.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-40000.rs:6:9
2+
--> $DIR/issue-40000.rs:10:9
33
|
44
LL | foo(bar);
55
| ^^^ one type is more general than the other

src/test/ui/issues/issue-40000.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/issue-40000.rs:6:9
2+
--> $DIR/issue-40000.rs:10:9
33
|
44
LL | foo(bar);
55
| ^^^ one type is more general than the other
@@ -8,7 +8,7 @@ LL | foo(bar);
88
found trait object `dyn Fn(&i32)`
99

1010
error[E0308]: mismatched types
11-
--> $DIR/issue-40000.rs:6:9
11+
--> $DIR/issue-40000.rs:10:9
1212
|
1313
LL | foo(bar);
1414
| ^^^ one type is more general than the other

src/test/ui/issues/issue-40000.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
fn main() {
26
let bar: fn(&mut u32) = |_| {};
37

48
fn foo(x: Box<dyn Fn(&i32)>) {}
59
let bar = Box::new(|x: &i32| {}) as Box<dyn Fn(_)>;
6-
foo(bar); //~ ERROR E0308
10+
foo(bar);
11+
//~^ ERROR E0308
12+
//[nll]~^^ ERROR mismatched types
713
}

src/test/ui/issues/issue-46983.stderr renamed to src/test/ui/issues/issue-46983.base.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
2-
--> $DIR/issue-46983.rs:2:5
2+
--> $DIR/issue-46983.rs:6:5
33
|
44
LL | fn foo(x: &u32) -> &'static u32 {
55
| ---- this data with an anonymous lifetime `'_`...

src/test/ui/issues/issue-46983.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-46983.rs:2:5
2+
--> $DIR/issue-46983.rs:6:5
33
|
44
LL | fn foo(x: &u32) -> &'static u32 {
55
| - let's call the lifetime of this reference `'1`

src/test/ui/issues/issue-46983.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
// revisions: base nll
2+
// ignore-compare-mode-nll
3+
//[nll] compile-flags: -Z borrowck=mir
4+
15
fn foo(x: &u32) -> &'static u32 {
26
&*x
3-
//~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
7+
//[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
8+
//[nll]~^^ ERROR lifetime may not live long enough
49
}
510

611
fn main() {}

src/test/ui/issues/issue-52533.stderr renamed to src/test/ui/issues/issue-52533.base.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error[E0312]: lifetime of reference outlives lifetime of borrowed content...
2-
--> $DIR/issue-52533.rs:5:16
2+
--> $DIR/issue-52533.rs:9:16
33
|
44
LL | foo(|a, b| b)
55
| ^
66
|
77
note: ...the reference is valid for the anonymous lifetime #1 defined here...
8-
--> $DIR/issue-52533.rs:5:9
8+
--> $DIR/issue-52533.rs:9:9
99
|
1010
LL | foo(|a, b| b)
1111
| ^^^^^^^^
1212
note: ...but the borrowed content is only valid for the anonymous lifetime #2 defined here
13-
--> $DIR/issue-52533.rs:5:9
13+
--> $DIR/issue-52533.rs:9:9
1414
|
1515
LL | foo(|a, b| b)
1616
| ^^^^^^^^

src/test/ui/issues/issue-52533.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-52533.rs:5:16
2+
--> $DIR/issue-52533.rs:9:16
33
|
44
LL | foo(|a, b| b)
55
| - - ^ closure was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`

0 commit comments

Comments
 (0)