Skip to content

Commit 6787e25

Browse files
committed
Blindly update the #[rustc_region] tests which got touched by the NLL diagnostic change.
1 parent e8c2995 commit 6787e25

16 files changed

+254
-254
lines changed

src/test/ui/nll/closure-requirements/escape-argument-callee.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ warning: not reporting region error due to nll
44
LL | let mut closure = expect_sig(|p, y| *p = y);
55
| ^
66

7-
error: unsatisfied lifetime constraints
8-
--> $DIR/escape-argument-callee.rs:36:45
9-
|
10-
LL | let mut closure = expect_sig(|p, y| *p = y);
11-
| - - ^^^^^^ requires that `'1` must outlive `'2`
12-
| | |
13-
| | has type `&'1 i32`
14-
| has type `&mut &'2 i32`
15-
167
note: No external requirements
178
--> $DIR/escape-argument-callee.rs:36:38
189
|
@@ -24,6 +15,15 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
2415
for<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) mut &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) i32))
2516
]
2617

18+
error: unsatisfied lifetime constraints
19+
--> $DIR/escape-argument-callee.rs:36:45
20+
|
21+
LL | let mut closure = expect_sig(|p, y| *p = y);
22+
| - - ^^^^^^ requires that `'1` must outlive `'2`
23+
| | |
24+
| | has type `&'1 i32`
25+
| has type `&mut &'2 i32`
26+
2727
note: No external requirements
2828
--> $DIR/escape-argument-callee.rs:30:1
2929
|

src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ warning: not reporting region error due to nll
44
LL | let p = x.get();
55
| ^^^^^^^
66

7-
error: unsatisfied lifetime constraints
8-
--> $DIR/propagate-approximated-fail-no-postdom.rs:57:13
9-
|
10-
LL | |_outlives1, _outlives2, _outlives3, x, y| {
11-
| ---------- ---------- has type `std::cell::Cell<&'2 &u32>`
12-
| |
13-
| has type `std::cell::Cell<&&'1 u32>`
14-
...
15-
LL | demand_y(x, y, p) //~ ERROR
16-
| ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
17-
187
note: No external requirements
198
--> $DIR/propagate-approximated-fail-no-postdom.rs:53:9
209
|
@@ -31,6 +20,17 @@ LL | | },
3120
for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))
3221
]
3322

23+
error: unsatisfied lifetime constraints
24+
--> $DIR/propagate-approximated-fail-no-postdom.rs:57:13
25+
|
26+
LL | |_outlives1, _outlives2, _outlives3, x, y| {
27+
| ---------- ---------- has type `std::cell::Cell<&'2 &u32>`
28+
| |
29+
| has type `std::cell::Cell<&&'1 u32>`
30+
...
31+
LL | demand_y(x, y, p) //~ ERROR
32+
| ^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
33+
3434
note: No external requirements
3535
--> $DIR/propagate-approximated-fail-no-postdom.rs:48:1
3636
|

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ warning: not reporting region error due to nll
44
LL | foo(cell, |cell_a, cell_x| {
55
| ^^^
66

7-
error: borrowed data escapes outside of closure
8-
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9
9-
|
10-
LL | foo(cell, |cell_a, cell_x| {
11-
| ------ ------ `cell_x` is a reference that is only valid in the closure body
12-
| |
13-
| `cell_a` is declared here, outside of the closure body
14-
LL | //~^ WARNING not reporting region error due to nll
15-
LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
17-
187
note: No external requirements
198
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:31:15
209
|
@@ -31,6 +20,17 @@ LL | | })
3120
for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) u32>))
3221
]
3322

23+
error: borrowed data escapes outside of closure
24+
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:33:9
25+
|
26+
LL | foo(cell, |cell_a, cell_x| {
27+
| ------ ------ `cell_x` is a reference that is only valid in the closure body
28+
| |
29+
| `cell_a` is declared here, outside of the closure body
30+
LL | //~^ WARNING not reporting region error due to nll
31+
LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
32+
| ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
33+
3434
note: No external requirements
3535
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1
3636
|

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@ LL | | });
2323
= note: number of external vids: 4
2424
= note: where '_#1r: '_#0r
2525

26-
error: borrowed data escapes outside of function
27-
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5
28-
|
29-
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
30-
| ------ `cell_a` is a reference that is only valid in the function body
31-
LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
32-
LL | | //~^ ERROR
33-
LL | |
34-
LL | | // Only works if 'x: 'y:
35-
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
36-
LL | | });
37-
| |______^ `cell_a` escapes the function body here
38-
3926
note: No external requirements
4027
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1
4128
|
@@ -50,5 +37,18 @@ LL | | }
5037
|
5138
= note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs []
5239

40+
error: borrowed data escapes outside of function
41+
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5
42+
|
43+
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
44+
| ------ `cell_a` is a reference that is only valid in the function body
45+
LL | / establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
46+
LL | | //~^ ERROR
47+
LL | |
48+
LL | | // Only works if 'x: 'y:
49+
LL | | demand_y(x, y, x.get()) //~ WARNING not reporting region error due to nll
50+
LL | | });
51+
| |______^ `cell_a` escapes the function body here
52+
5353
error: aborting due to previous error
5454

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@ LL | | });
2323
= note: number of external vids: 5
2424
= note: where '_#1r: '_#0r
2525

26-
error: borrowed data escapes outside of function
27-
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5
28-
|
29-
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
30-
| ------ `cell_a` is a reference that is only valid in the function body
31-
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
32-
LL | | //~^ ERROR
33-
LL | | // Only works if 'x: 'y:
34-
LL | | demand_y(x, y, x.get())
35-
LL | | //~^ WARNING not reporting region error due to nll
36-
LL | | });
37-
| |______^ `cell_a` escapes the function body here
38-
3926
note: No external requirements
4027
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1
4128
|
@@ -50,5 +37,18 @@ LL | | }
5037
|
5138
= note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs []
5239

40+
error: borrowed data escapes outside of function
41+
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5
42+
|
43+
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
44+
| ------ `cell_a` is a reference that is only valid in the function body
45+
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
46+
LL | | //~^ ERROR
47+
LL | | // Only works if 'x: 'y:
48+
LL | | demand_y(x, y, x.get())
49+
LL | | //~^ WARNING not reporting region error due to nll
50+
LL | | });
51+
| |______^ `cell_a` escapes the function body here
52+
5353
error: aborting due to previous error
5454

src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ warning: not reporting region error due to nll
44
LL | demand_y(x, y, x.get())
55
| ^^^^^^^^^^^^^^^^^^^^^^^
66

7-
error: unsatisfied lifetime constraints
8-
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:47:9
9-
|
10-
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
11-
| --------- - has type `&std::cell::Cell<&'1 u32>`
12-
| |
13-
| has type `&std::cell::Cell<&'2 &u32>`
14-
LL | // Only works if 'x: 'y:
15-
LL | demand_y(x, y, x.get())
16-
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
17-
187
note: No external requirements
198
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:45:47
209
|
@@ -32,6 +21,17 @@ LL | | });
3221
for<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>))
3322
]
3423

24+
error: unsatisfied lifetime constraints
25+
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:47:9
26+
|
27+
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
28+
| --------- - has type `&std::cell::Cell<&'1 u32>`
29+
| |
30+
| has type `&std::cell::Cell<&'2 &u32>`
31+
LL | // Only works if 'x: 'y:
32+
LL | demand_y(x, y, x.get())
33+
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
34+
3535
note: No external requirements
3636
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:44:1
3737
|

src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ warning: not reporting region error due to nll
44
LL | demand_y(x, y, x.get())
55
| ^^^^^^^^^^^^^^^^^^^^^^^
66

7-
error: unsatisfied lifetime constraints
8-
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9
9-
|
10-
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
11-
| ---------- ---------- has type `&std::cell::Cell<&'2 &u32>`
12-
| |
13-
| has type `&std::cell::Cell<&'1 &u32>`
14-
LL | // Only works if 'x: 'y:
15-
LL | demand_y(x, y, x.get())
16-
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
17-
187
note: No external requirements
198
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:49:47
209
|
@@ -32,6 +21,17 @@ LL | | });
3221
for<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't0)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't2)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) u32>, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't3)) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 't1)) u32>))
3322
]
3423

24+
error: unsatisfied lifetime constraints
25+
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:51:9
26+
|
27+
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
28+
| ---------- ---------- has type `&std::cell::Cell<&'2 &u32>`
29+
| |
30+
| has type `&std::cell::Cell<&'1 &u32>`
31+
LL | // Only works if 'x: 'y:
32+
LL | demand_y(x, y, x.get())
33+
| ^^^^^^^^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'2`
34+
3535
note: No external requirements
3636
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:48:1
3737
|

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

+15-15
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,6 @@ LL | | });
2626
= note: number of external vids: 3
2727
= note: where T: '_#1r
2828

29-
error[E0309]: the parameter type `T` may not live long enough
30-
--> $DIR/propagate-from-trait-match.rs:42:36
31-
|
32-
LL | establish_relationships(value, |value| {
33-
| ____________________________________^
34-
LL | | //~^ ERROR the parameter type `T` may not live long enough
35-
LL | |
36-
LL | | // This function call requires that
37-
... |
38-
LL | | //~^ WARNING not reporting region error due to nll
39-
LL | | });
40-
| |_____^
41-
|
42-
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
43-
4429
note: No external requirements
4530
--> $DIR/propagate-from-trait-match.rs:38:1
4631
|
@@ -58,6 +43,21 @@ LL | | }
5843
T
5944
]
6045

46+
error[E0309]: the parameter type `T` may not live long enough
47+
--> $DIR/propagate-from-trait-match.rs:42:36
48+
|
49+
LL | establish_relationships(value, |value| {
50+
| ____________________________________^
51+
LL | | //~^ ERROR the parameter type `T` may not live long enough
52+
LL | |
53+
LL | | // This function call requires that
54+
... |
55+
LL | | //~^ WARNING not reporting region error due to nll
56+
LL | | });
57+
| |_____^
58+
|
59+
= help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...
60+
6161
error: aborting due to previous error
6262

6363
For more information about this error, try `rustc --explain E0309`.

src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ warning: not reporting region error due to nll
44
LL | expect_sig(|a, b| b); // ought to return `a`
55
| ^
66

7-
error: unsatisfied lifetime constraints
8-
--> $DIR/return-wrong-bound-region.rs:21:23
9-
|
10-
LL | expect_sig(|a, b| b); // ought to return `a`
11-
| - - ^ closure was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
12-
| | |
13-
| | has type `&'1 i32`
14-
| has type `&'2 i32`
15-
167
note: No external requirements
178
--> $DIR/return-wrong-bound-region.rs:21:16
189
|
@@ -24,6 +15,15 @@ LL | expect_sig(|a, b| b); // ought to return `a`
2415
for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32, &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 's)) i32)) -> &ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(0:0), 'r)) i32
2516
]
2617

18+
error: unsatisfied lifetime constraints
19+
--> $DIR/return-wrong-bound-region.rs:21:23
20+
|
21+
LL | expect_sig(|a, b| b); // ought to return `a`
22+
| - - ^ closure was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
23+
| | |
24+
| | has type `&'1 i32`
25+
| has type `&'2 i32`
26+
2727
note: No external requirements
2828
--> $DIR/return-wrong-bound-region.rs:20:1
2929
|

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

+16-16
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
2525
= note: number of external vids: 4
2626
= note: where <T as std::iter::Iterator>::Item: '_#2r
2727

28-
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
29-
--> $DIR/projection-no-regions-closure.rs:35:23
30-
|
31-
LL | with_signature(x, |mut y| Box::new(y.next()))
32-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
33-
|
34-
= help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
35-
3628
note: No external requirements
3729
--> $DIR/projection-no-regions-closure.rs:31:1
3830
|
@@ -50,6 +42,14 @@ LL | | }
5042
T
5143
]
5244

45+
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
46+
--> $DIR/projection-no-regions-closure.rs:35:23
47+
|
48+
LL | with_signature(x, |mut y| Box::new(y.next()))
49+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
50+
|
51+
= help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
52+
5353
note: External requirements
5454
--> $DIR/projection-no-regions-closure.rs:45:23
5555
|
@@ -97,14 +97,6 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
9797
= note: number of external vids: 5
9898
= note: where <T as std::iter::Iterator>::Item: '_#3r
9999

100-
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
101-
--> $DIR/projection-no-regions-closure.rs:53:23
102-
|
103-
LL | with_signature(x, |mut y| Box::new(y.next()))
104-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
105-
|
106-
= help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
107-
108100
note: No external requirements
109101
--> $DIR/projection-no-regions-closure.rs:49:1
110102
|
@@ -123,6 +115,14 @@ LL | | }
123115
T
124116
]
125117

118+
error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough
119+
--> $DIR/projection-no-regions-closure.rs:53:23
120+
|
121+
LL | with_signature(x, |mut y| Box::new(y.next()))
122+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
123+
|
124+
= help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...
125+
126126
note: External requirements
127127
--> $DIR/projection-no-regions-closure.rs:64:23
128128
|

0 commit comments

Comments
 (0)