Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b1211e8

Browse files
committedSep 7, 2018
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() {}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/mir_check_cast_reify.rs:47:5
2+
--> $DIR/mir_check_cast_reify.rs:46:25
33
|
44
LL | fn bar<'a>(x: &'a u32) -> &'static u32 {
55
| -- lifetime `'a` defined here
66
...
7-
LL | f(x)
8-
| ^^^^ returning this value requires that `'a` must outlive `'static`
7+
LL | let f: fn(_) -> _ = foo;
8+
| ^^^ cast requires that `'a` must outlive `'static`
99

1010
error: aborting due to previous error
1111

‎src/test/ui/nll/mir_check_cast_unsafe_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
1616
// Here the NLL checker must relate the types in `f` to the types
1717
// in `g`. These are related via the `UnsafeFnPointer` cast.
1818
let g: unsafe fn(_) -> _ = f;
19+
//~^ ERROR unsatisfied lifetime constraints
1920
unsafe { g(input) }
20-
//~^ ERROR
2121
}
2222

2323
fn main() {}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/mir_check_cast_unsafe_fn.rs:19:14
2+
--> $DIR/mir_check_cast_unsafe_fn.rs:18:32
33
|
44
LL | fn bar<'a>(input: &'a u32, f: fn(&'a u32) -> &'a u32) -> &'static u32 {
55
| -- lifetime `'a` defined here
66
...
7-
LL | unsafe { g(input) }
8-
| ^^^^^^^^ returning this value requires that `'a` must outlive `'static`
7+
LL | let g: unsafe fn(_) -> _ = f;
8+
| ^ cast requires that `'a` must outlive `'static`
99

1010
error: aborting due to previous error
1111

‎src/test/ui/nll/mir_check_cast_unsize.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: unsatisfied lifetime constraints
44
LL | fn bar<'a>(x: &'a u32) -> &'static dyn Debug {
55
| -- lifetime `'a` defined here
66
LL | x
7-
| ^ returning this value requires that `'a` must outlive `'static`
7+
| ^ cast requires that `'a` must outlive `'static`
88

99
error: aborting due to previous error
1010

‎src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
1010
i32,
1111
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
1212
]
13-
= note: number of external vids: 4
13+
= note: number of external vids: 3
1414
= note: where <T as std::iter::Iterator>::Item: '_#2r
1515

1616
note: No external requirements
@@ -50,7 +50,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
5050
i32,
5151
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
5252
]
53-
= note: number of external vids: 4
53+
= note: number of external vids: 3
5454
= note: where <T as std::iter::Iterator>::Item: '_#2r
5555

5656
note: No external requirements
@@ -82,7 +82,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
8282
i32,
8383
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
8484
]
85-
= note: number of external vids: 5
85+
= note: number of external vids: 4
8686
= note: where <T as std::iter::Iterator>::Item: '_#3r
8787

8888
note: No external requirements
@@ -124,7 +124,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
124124
i32,
125125
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
126126
]
127-
= note: number of external vids: 5
127+
= note: number of external vids: 4
128128
= note: where <T as std::iter::Iterator>::Item: '_#3r
129129

130130
note: No external requirements

‎src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
1010
i32,
1111
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
1212
]
13-
= note: number of external vids: 5
13+
= note: number of external vids: 4
1414
= note: where T: '_#2r
1515
= note: where '_#1r: '_#2r
1616

@@ -63,7 +63,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
6363
i32,
6464
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
6565
]
66-
= note: number of external vids: 5
66+
= note: number of external vids: 4
6767
= note: where T: '_#3r
6868
= note: where '_#2r: '_#3r
6969

@@ -117,7 +117,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
117117
i32,
118118
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
119119
]
120-
= note: number of external vids: 5
120+
= note: number of external vids: 4
121121
= note: where T: '_#3r
122122
= note: where '_#2r: '_#3r
123123

@@ -171,7 +171,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
171171
i32,
172172
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
173173
]
174-
= note: number of external vids: 5
174+
= note: number of external vids: 4
175175
= note: where T: '_#3r
176176
= note: where '_#2r: '_#3r
177177

‎src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
1010
i32,
1111
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
1212
]
13-
= note: number of external vids: 5
13+
= note: number of external vids: 4
1414
= note: where '_#1r: '_#2r
1515

1616
note: No external requirements
@@ -54,7 +54,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
5454
i32,
5555
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
5656
]
57-
= note: number of external vids: 5
57+
= note: number of external vids: 4
5858
= note: where '_#2r: '_#3r
5959

6060
note: No external requirements
@@ -99,7 +99,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
9999
i32,
100100
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
101101
]
102-
= note: number of external vids: 5
102+
= note: number of external vids: 4
103103
= note: where '_#2r: '_#3r
104104

105105
note: No external requirements
@@ -144,7 +144,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
144144
i32,
145145
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
146146
]
147-
= note: number of external vids: 5
147+
= note: number of external vids: 4
148148
= note: where '_#2r: '_#3r
149149

150150
note: No external requirements
@@ -177,7 +177,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
177177
i32,
178178
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
179179
]
180-
= note: number of external vids: 4
180+
= note: number of external vids: 3
181181
= note: where '_#1r: '_#2r
182182

183183
note: No external requirements

‎src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ where
4646
T: Anything<'b, 'c>,
4747
{
4848
with_signature(cell, t, |cell, t| require(cell, t));
49-
//~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
49+
//~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
5050
}
5151

5252
#[rustc_regions]
@@ -56,7 +56,7 @@ where
5656
'a: 'a,
5757
{
5858
with_signature(cell, t, |cell, t| require(cell, t));
59-
//~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
59+
//~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
6060
}
6161

6262
#[rustc_regions]
@@ -76,7 +76,7 @@ where
7676
// can do better here with a more involved verification step.
7777

7878
with_signature(cell, t, |cell, t| require(cell, t));
79-
//~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
79+
//~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
8080
}
8181

8282
#[rustc_regions]
@@ -103,7 +103,7 @@ where
103103
T: Anything<'b, 'b>,
104104
{
105105
with_signature(cell, t, |cell, t| require(cell, t));
106-
//~^ ERROR
106+
//~^ ERROR unsatisfied lifetime constraints
107107
}
108108

109109
#[rustc_regions]

‎src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
1111
i32,
1212
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
1313
]
14-
= note: number of external vids: 6
14+
= note: number of external vids: 5
1515
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#2r)>>::AssocType: '_#3r
1616

1717
note: No external requirements
@@ -22,7 +22,7 @@ LL | | where
2222
LL | | T: Anything<'b, 'c>,
2323
LL | | {
2424
LL | | with_signature(cell, t, |cell, t| require(cell, t));
25-
LL | | //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
25+
LL | | //~^ ERROR associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
2626
LL | | }
2727
| |_^
2828
|
@@ -32,13 +32,13 @@ LL | | }
3232
T
3333
]
3434

35-
error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
35+
error[E0309]: the associated type `<T as Anything<'_#5r, '_#6r>>::AssocType` may not live long enough
3636
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
3737
|
3838
LL | with_signature(cell, t, |cell, t| require(cell, t));
3939
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
4040
|
41-
= help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
41+
= help: consider adding an explicit lifetime bound `<T as Anything<'_#5r, '_#6r>>::AssocType: ReFree(DefId(0/0:8 ~ projection_two_region_trait_bound_closure[317d]::no_relationships_late[0]), BrNamed(crate0:DefIndex(1:18), 'a))`...
4242

4343
note: External requirements
4444
--> $DIR/projection-two-region-trait-bound-closure.rs:58:29
@@ -54,7 +54,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
5454
i32,
5555
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
5656
]
57-
= note: number of external vids: 6
57+
= note: number of external vids: 5
5858
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
5959

6060
note: No external requirements
@@ -65,7 +65,7 @@ LL | | where
6565
LL | | T: Anything<'b, 'c>,
6666
LL | | 'a: 'a,
6767
... |
68-
LL | | //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
68+
LL | | //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
6969
LL | | }
7070
| |_^
7171
|
@@ -76,13 +76,13 @@ LL | | }
7676
T
7777
]
7878

79-
error[E0309]: the associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
79+
error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
8080
--> $DIR/projection-two-region-trait-bound-closure.rs:58:29
8181
|
8282
LL | with_signature(cell, t, |cell, t| require(cell, t));
8383
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
8484
|
85-
= help: consider adding an explicit lifetime bound `<T as Anything<'_#7r, '_#8r>>::AssocType: ReEarlyBound(0, 'a)`...
85+
= help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
8686

8787
note: External requirements
8888
--> $DIR/projection-two-region-trait-bound-closure.rs:78:29
@@ -98,7 +98,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
9898
i32,
9999
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
100100
]
101-
= note: number of external vids: 6
101+
= note: number of external vids: 5
102102
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
103103

104104
note: No external requirements
@@ -109,7 +109,7 @@ LL | | where
109109
LL | | T: Anything<'b, 'c>,
110110
LL | | T::AssocType: 'a,
111111
... |
112-
LL | | //~^ ERROR associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
112+
LL | | //~^ ERROR associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
113113
LL | | }
114114
| |_^
115115
|
@@ -120,13 +120,13 @@ LL | | }
120120
T
121121
]
122122

123-
error[E0309]: the associated type `<T as Anything<'_#7r, '_#8r>>::AssocType` may not live long enough
123+
error[E0309]: the associated type `<T as Anything<'_#6r, '_#7r>>::AssocType` may not live long enough
124124
--> $DIR/projection-two-region-trait-bound-closure.rs:78:29
125125
|
126126
LL | with_signature(cell, t, |cell, t| require(cell, t));
127127
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
128128
|
129-
= help: consider adding an explicit lifetime bound `<T as Anything<'_#7r, '_#8r>>::AssocType: ReEarlyBound(0, 'a)`...
129+
= help: consider adding an explicit lifetime bound `<T as Anything<'_#6r, '_#7r>>::AssocType: ReEarlyBound(0, 'a)`...
130130

131131
note: External requirements
132132
--> $DIR/projection-two-region-trait-bound-closure.rs:88:29
@@ -142,7 +142,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
142142
i32,
143143
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
144144
]
145-
= note: number of external vids: 6
145+
= note: number of external vids: 5
146146
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
147147

148148
note: No external requirements
@@ -178,7 +178,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
178178
i32,
179179
extern "rust-call" fn((std::cell::Cell<&'_#4r ()>, T))
180180
]
181-
= note: number of external vids: 6
181+
= note: number of external vids: 5
182182
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#3r)>>::AssocType: '_#4r
183183

184184
note: No external requirements
@@ -212,7 +212,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
212212
i32,
213213
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
214214
]
215-
= note: number of external vids: 5
215+
= note: number of external vids: 4
216216
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
217217

218218
note: No external requirements
@@ -223,7 +223,7 @@ LL | | where
223223
LL | | T: Anything<'b, 'b>,
224224
LL | | {
225225
LL | | with_signature(cell, t, |cell, t| require(cell, t));
226-
LL | | //~^ ERROR
226+
LL | | //~^ ERROR unsatisfied lifetime constraints
227227
LL | | }
228228
| |_^
229229
|
@@ -256,7 +256,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
256256
i32,
257257
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
258258
]
259-
= note: number of external vids: 5
259+
= note: number of external vids: 4
260260
= note: where <T as Anything<ReClosureBound('_#2r), ReClosureBound('_#2r)>>::AssocType: '_#3r
261261

262262
note: No external requirements
@@ -289,7 +289,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
289289
i32,
290290
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
291291
]
292-
= note: number of external vids: 4
292+
= note: number of external vids: 3
293293
= note: where <T as Anything<ReClosureBound('_#1r), ReClosureBound('_#1r)>>::AssocType: '_#2r
294294

295295
note: No external requirements

‎src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | twice(cell, value, |a, b| invoke(a, b));
99
i16,
1010
for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
1111
]
12-
= note: number of external vids: 3
12+
= note: number of external vids: 2
1313
= note: where T: '_#1r
1414

1515
note: No external requirements
@@ -36,7 +36,7 @@ LL | twice(cell, value, |a, b| invoke(a, b));
3636
i16,
3737
for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) ()>>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) T))
3838
]
39-
= note: number of external vids: 4
39+
= note: number of external vids: 3
4040
= note: where T: '_#1r
4141

4242
note: No external requirements

‎src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | with_signature(x, |y| y)
1010
i32,
1111
extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>
1212
]
13-
= note: number of external vids: 4
13+
= note: number of external vids: 3
1414
= note: where T: '_#2r
1515

1616
note: No external requirements

‎src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LL | | })
1616
i32,
1717
extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, T))
1818
]
19-
= note: number of external vids: 4
19+
= note: number of external vids: 3
2020
= note: where T: '_#1r
2121

2222
note: No external requirements
@@ -69,7 +69,7 @@ LL | | })
6969
i32,
7070
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
7171
]
72-
= note: number of external vids: 4
72+
= note: number of external vids: 3
7373
= note: where T: '_#2r
7474

7575
note: No external requirements
@@ -106,7 +106,7 @@ LL | | })
106106
i32,
107107
extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T))
108108
]
109-
= note: number of external vids: 5
109+
= note: number of external vids: 4
110110
= note: where T: '_#2r
111111

112112
note: No external requirements
@@ -156,7 +156,7 @@ LL | | })
156156
i32,
157157
extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T))
158158
]
159-
= note: number of external vids: 5
159+
= note: number of external vids: 4
160160
= note: where T: '_#3r
161161

162162
note: No external requirements
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/regions-addr-of-self.rs:17:37
2+
--> $DIR/regions-addr-of-self.rs:17:13
33
|
44
LL | pub fn chase_cat(&mut self) {
55
| - let's call the lifetime of this reference `'1`
66
LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer
7-
| ^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
7+
| ^ requires that `'1` must outlive `'static`
88

99
error: aborting due to previous error
1010

‎src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/regions-addr-of-upvar-self.rs:20:41
2+
--> $DIR/regions-addr-of-upvar-self.rs:20:17
33
|
44
LL | let _f = || {
55
| -- lifetime `'1` represents this closure's body
66
LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
7-
| ^^^^^^^^^^^^^^ requires that `'1` must outlive `'static`
7+
| ^ requires that `'1` must outlive `'static`
8+
|
9+
= note: closure implements `FnMut`, so references to captured variables can't escape the closure
10+
11+
error: unsatisfied lifetime constraints
12+
--> $DIR/regions-addr-of-upvar-self.rs:20:17
13+
|
14+
LL | pub fn chase_cat(&mut self) {
15+
| --------- lifetime `'2` appears in the type of `self`
16+
LL | let _f = || {
17+
| -- lifetime `'1` represents this closure's body
18+
LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer
19+
| ^ requires that `'1` must outlive `'2`
820
|
921
= note: closure implements `FnMut`, so references to captured variables can't escape the closure
1022

@@ -29,6 +41,6 @@ LL | }
2941
|
3042
= note: borrowed value must be valid for the static lifetime...
3143

32-
error: aborting due to 3 previous errors
44+
error: aborting due to 4 previous errors
3345

3446
For more information about this error, try `rustc --explain E0597`.

‎src/test/ui/regions/regions-close-object-into-object-2.nll.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/regions-close-object-into-object-2.rs:20:5
2+
--> $DIR/regions-close-object-into-object-2.rs:20:11
33
|
44
LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> {
55
| -- lifetime `'a` defined here
66
LL | box B(&*v) as Box<X> //~ ERROR cannot infer
7-
| ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
7+
| ^^^ cast requires that `'a` must outlive `'static`
88

99
error[E0597]: `*v` does not live long enough
1010
--> $DIR/regions-close-object-into-object-2.rs:20:11

‎src/test/ui/regions/regions-close-object-into-object-4.nll.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ LL | box B(&*v) as Box<X> //~ ERROR cannot infer
66
|
77
= help: consider adding an explicit lifetime bound `U: 'static`...
88

9-
error: unsatisfied lifetime constraints
10-
--> $DIR/regions-close-object-into-object-4.rs:20:5
11-
|
12-
LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
13-
| -- lifetime `'a` defined here
14-
LL | box B(&*v) as Box<X> //~ ERROR cannot infer
15-
| ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
16-
179
error[E0310]: the parameter type `U` may not live long enough
1810
--> $DIR/regions-close-object-into-object-4.rs:20:9
1911
|
@@ -22,6 +14,14 @@ LL | box B(&*v) as Box<X> //~ ERROR cannot infer
2214
|
2315
= help: consider adding an explicit lifetime bound `U: 'static`...
2416

17+
error: unsatisfied lifetime constraints
18+
--> $DIR/regions-close-object-into-object-4.rs:20:11
19+
|
20+
LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {
21+
| -- lifetime `'a` defined here
22+
LL | box B(&*v) as Box<X> //~ ERROR cannot infer
23+
| ^^^ cast requires that `'a` must outlive `'static`
24+
2525
error[E0597]: `*v` does not live long enough
2626
--> $DIR/regions-close-object-into-object-4.rs:20:11
2727
|

‎src/test/ui/regions/regions-static-bound.ll.nll.stderr

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,35 @@ LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of
1515
| ^^^^^^^^^^^^^ lifetime `'static` required
1616

1717
error[E0621]: explicit lifetime required in the type of `v`
18-
--> $DIR/regions-static-bound.rs:26:5
18+
--> $DIR/regions-static-bound.rs:27:5
1919
|
2020
LL | fn error(u: &(), v: &()) {
2121
| --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
2222
...
2323
LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
2424
| ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
2525

26-
error: aborting due to 3 previous errors
26+
error: unsatisfied lifetime constraints
27+
--> $DIR/regions-static-bound.rs:24:5
28+
|
29+
LL | fn error(u: &(), v: &()) {
30+
| - - let's call the lifetime of this reference `'2`
31+
| |
32+
| let's call the lifetime of this reference `'1`
33+
LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
34+
| ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
35+
36+
error: unsatisfied lifetime constraints
37+
--> $DIR/regions-static-bound.rs:27:5
38+
|
39+
LL | fn error(u: &(), v: &()) {
40+
| - - let's call the lifetime of this reference `'1`
41+
| |
42+
| let's call the lifetime of this reference `'2`
43+
...
44+
LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
45+
| ^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
46+
47+
error: aborting due to 5 previous errors
2748

2849
For more information about this error, try `rustc --explain E0621`.

‎src/test/ui/regions/regions-static-bound.ll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of
2020
| ^^^^^^^^^ lifetime `'static` required
2121

2222
error[E0621]: explicit lifetime required in the type of `v`
23-
--> $DIR/regions-static-bound.rs:26:5
23+
--> $DIR/regions-static-bound.rs:27:5
2424
|
2525
LL | fn error(u: &(), v: &()) {
2626
| --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`

‎src/test/ui/regions/regions-static-bound.nll.stderr

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,35 @@ LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of
1515
| ^^^^^^^^^^^^^ lifetime `'static` required
1616

1717
error[E0621]: explicit lifetime required in the type of `v`
18-
--> $DIR/regions-static-bound.rs:26:5
18+
--> $DIR/regions-static-bound.rs:27:5
1919
|
2020
LL | fn error(u: &(), v: &()) {
2121
| --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()`
2222
...
2323
LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
2424
| ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
2525

26-
error: aborting due to 3 previous errors
26+
error: unsatisfied lifetime constraints
27+
--> $DIR/regions-static-bound.rs:24:5
28+
|
29+
LL | fn error(u: &(), v: &()) {
30+
| - - let's call the lifetime of this reference `'2`
31+
| |
32+
| let's call the lifetime of this reference `'1`
33+
LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
34+
| ^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
35+
36+
error: unsatisfied lifetime constraints
37+
--> $DIR/regions-static-bound.rs:27:5
38+
|
39+
LL | fn error(u: &(), v: &()) {
40+
| - - let's call the lifetime of this reference `'1`
41+
| |
42+
| let's call the lifetime of this reference `'2`
43+
...
44+
LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
45+
| ^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
46+
47+
error: aborting due to 5 previous errors
2748

2849
For more information about this error, try `rustc --explain E0621`.

‎src/test/ui/regions/regions-static-bound.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a {
2323
fn error(u: &(), v: &()) {
2424
static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621]
2525
//[nll]~^ ERROR explicit lifetime required in the type of `u` [E0621]
26+
//[nll]~| ERROR unsatisfied lifetime constraints
2627
static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621]
2728
//[nll]~^ ERROR explicit lifetime required in the type of `v` [E0621]
29+
//[nll]~| ERROR unsatisfied lifetime constraints
2830
}
2931

3032
fn main() {}

‎src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
55
| - let's call the lifetime of this reference `'1`
66
LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
77
LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
8-
| ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
8+
| ^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)
Please sign in to comment.