Skip to content

Commit b1211e8

Browse files
committed
Fix tests
1 parent 5390cf3 commit b1211e8

31 files changed

+194
-91
lines changed

src/test/mir-opt/nll/named-lifetimes-basic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn main() {
3434
// | '_#4r | Local | ['_#4r]
3535
// |
3636
// | Inferred Region Values
37-
// | '_#0r | U0 | {bb0[0..=1], '_#0r}
37+
// | '_#0r | U0 | {bb0[0..=1], '_#0r, '_#1r, '_#2r, '_#3r, '_#4r}
3838
// | '_#1r | U0 | {bb0[0..=1], '_#1r}
3939
// | '_#2r | U0 | {bb0[0..=1], '_#2r}
4040
// | '_#3r | U0 | {bb0[0..=1], '_#3r}

src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,15 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
66
LL | bar(foo, x) //[transmute]~ ERROR E0495
77
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
88

9-
error: aborting due to previous error
9+
error: unsatisfied lifetime constraints
10+
--> $DIR/project-fn-ret-contravariant.rs:48:4
11+
|
12+
LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
13+
| -- -- lifetime `'b` defined here
14+
| |
15+
| lifetime `'a` defined here
16+
LL | bar(foo, x) //[transmute]~ ERROR E0495
17+
| ^^^^^^^^^^^ requires that `'a` must outlive `'b`
18+
19+
error: aborting due to 2 previous errors
1020

src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,16 @@ LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
77
LL | bar(foo, x) //[transmute]~ ERROR E0495
88
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
99

10-
error: aborting due to previous error
10+
error: unsatisfied lifetime constraints
11+
--> $DIR/project-fn-ret-invariant.rs:58:13
12+
|
13+
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
14+
| -- -- lifetime `'b` defined here
15+
| |
16+
| lifetime `'a` defined here
17+
...
18+
LL | bar(foo, x) //[transmute]~ ERROR E0495
19+
| ^ requires that `'a` must outlive `'b`
20+
21+
error: aborting due to 2 previous errors
1122

src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ error: unsatisfied lifetime constraints
44
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
55
| - let's call the lifetime of this reference `'1`
66
LL | self.x.iter().map(|a| a.0)
7-
| ^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
7+
| ^^^^^^ cast requires that `'1` must outlive `'static`
88

99
error: unsatisfied lifetime constraints
1010
--> $DIR/static-return-lifetime-infered.rs:21:9
1111
|
1212
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
1313
| -- lifetime `'a` defined here
1414
LL | self.x.iter().map(|a| a.0)
15-
| ^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
15+
| ^^^^^^ cast requires that `'a` must outlive `'static`
1616

1717
error: aborting due to 2 previous errors
1818

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
4343
#[rustc_regions]
4444
fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
4545
establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
46-
//~^ ERROR
46+
//~^ ERROR borrowed data escapes outside of function
47+
//~| ERROR unsatisfied lifetime constraints
4748

4849
// Only works if 'x: 'y:
4950
demand_y(x, y, x.get())

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ note: External requirements
33
|
44
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
55
| _______________________________________________^
6-
LL | | //~^ ERROR
6+
LL | | //~^ ERROR borrowed data escapes outside of function
7+
LL | | //~| ERROR unsatisfied lifetime constraints
78
LL | |
89
LL | | // Only works if 'x: 'y:
910
LL | | demand_y(x, y, x.get())
@@ -22,8 +23,8 @@ note: No external requirements
2223
|
2324
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
2425
LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
25-
LL | | //~^ ERROR
26-
LL | |
26+
LL | | //~^ ERROR borrowed data escapes outside of function
27+
LL | | //~| ERROR unsatisfied lifetime constraints
2728
... |
2829
LL | | });
2930
LL | | }
@@ -37,12 +38,23 @@ error: borrowed data escapes outside of function
3738
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
3839
| ------ `cell_a` is a reference that is only valid in the function body
3940
LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
40-
LL | | //~^ ERROR
41+
LL | | //~^ ERROR borrowed data escapes outside of function
42+
LL | | //~| ERROR unsatisfied lifetime constraints
4143
LL | |
4244
LL | | // Only works if 'x: 'y:
4345
LL | | demand_y(x, y, x.get())
4446
LL | | });
4547
| |______^ `cell_a` escapes the function body here
4648

47-
error: aborting due to previous error
49+
error: unsatisfied lifetime constraints
50+
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:29
51+
|
52+
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
53+
| -- -- lifetime `'b` defined here
54+
| |
55+
| lifetime `'a` defined here
56+
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
57+
| ^^^^^^^ requires that `'a` must outlive `'b`
58+
59+
error: aborting due to 2 previous errors
4860

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ fn demand_y<'x, 'y>(_cell_x: &Cell<&'x u32>, _cell_y: &Cell<&'y u32>, _y: &'y u3
4646
#[rustc_regions]
4747
fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
4848
establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
49-
//~^ ERROR
49+
//~^ ERROR borrowed data escapes outside of function
50+
//~| ERROR unsatisfied lifetime constraints
5051
// Only works if 'x: 'y:
5152
demand_y(x, y, x.get())
5253
});

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ note: External requirements
33
|
44
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
55
| _______________________________________________^
6-
LL | | //~^ ERROR
6+
LL | | //~^ ERROR borrowed data escapes outside of function
7+
LL | | //~| ERROR unsatisfied lifetime constraints
78
LL | | // Only works if 'x: 'y:
89
LL | | demand_y(x, y, x.get())
910
LL | | });
@@ -21,9 +22,9 @@ note: No external requirements
2122
|
2223
LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
2324
LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
24-
LL | | //~^ ERROR
25-
LL | | // Only works if 'x: 'y:
26-
LL | | demand_y(x, y, x.get())
25+
LL | | //~^ ERROR borrowed data escapes outside of function
26+
LL | | //~| ERROR unsatisfied lifetime constraints
27+
... |
2728
LL | | });
2829
LL | | }
2930
| |_^
@@ -36,11 +37,22 @@ error: borrowed data escapes outside of function
3637
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
3738
| ------ `cell_a` is a reference that is only valid in the function body
3839
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
39-
LL | | //~^ ERROR
40+
LL | | //~^ ERROR borrowed data escapes outside of function
41+
LL | | //~| ERROR unsatisfied lifetime constraints
4042
LL | | // Only works if 'x: 'y:
4143
LL | | demand_y(x, y, x.get())
4244
LL | | });
4345
| |______^ `cell_a` escapes the function body here
4446

45-
error: aborting due to previous error
47+
error: unsatisfied lifetime constraints
48+
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:29
49+
|
50+
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
51+
| -- -- lifetime `'b` defined here
52+
| |
53+
| lifetime `'a` defined here
54+
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
55+
| ^^^^^^^ requires that `'a` must outlive `'b`
56+
57+
error: aborting due to 2 previous errors
4658

src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL | | });
1717
i32,
1818
extern "rust-call" fn((T,))
1919
]
20-
= note: number of external vids: 3
20+
= note: number of external vids: 2
2121
= note: where T: '_#1r
2222

2323
note: No external requirements

src/test/ui/nll/mir_check_cast_reify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ fn bar<'a>(x: &'a u32) -> &'static u32 {
4444
// The MIR type checker must therefore relate `'?0` to `'?1` and `'?2`
4545
// as part of checking the `ReifyFnPointer`.
4646
let f: fn(_) -> _ = foo;
47+
//~^ ERROR unsatisfied lifetime constraints
4748
f(x)
48-
//~^ ERROR
4949
}
5050

5151
fn main() {}

0 commit comments

Comments
 (0)