Skip to content

Commit bd0895d

Browse files
committed
Update ui tests
1 parent 994dc4b commit bd0895d

File tree

51 files changed

+205
-174
lines changed

Some content is hidden

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

51 files changed

+205
-174
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/project-fn-ret-contravariant.rs:53:12
2+
--> $DIR/project-fn-ret-contravariant.rs:55:4
33
|
44
LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
55
| -- -- lifetime `'b` defined here
66
| |
77
| lifetime `'a` defined here
8-
LL | let a = bar(foo, y);
9-
| ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
8+
...
9+
LL | (a, b) //[krisskross]~ ERROR 55:5: 55:6: lifetime mismatch [E0623]
10+
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
1011

1112
error: unsatisfied lifetime constraints
12-
--> $DIR/project-fn-ret-contravariant.rs:54:12
13+
--> $DIR/project-fn-ret-contravariant.rs:55:4
1314
|
1415
LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) {
1516
| -- -- lifetime `'b` defined here
1617
| |
1718
| lifetime `'a` defined here
18-
LL | let a = bar(foo, y);
19-
LL | let b = bar(foo, x);
20-
| ^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
19+
...
20+
LL | (a, b) //[krisskross]~ ERROR 55:5: 55:6: lifetime mismatch [E0623]
21+
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
2122

2223
error: aborting due to 2 previous errors
2324

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 {
1414
| |
1515
| lifetime `'a` defined here
1616
LL | bar(foo, x) //[transmute]~ ERROR E0495
17-
| ^^^^^^^^^^^ requires that `'a` must outlive `'b`
17+
| ^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
1818

1919
error: aborting due to 2 previous errors
2020

Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/project-fn-ret-invariant.rs:63:12
2+
--> $DIR/project-fn-ret-invariant.rs:65:4
33
|
44
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
55
| -- -- lifetime `'b` defined here
66
| |
77
| lifetime `'a` defined here
8-
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
9-
| ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`
8+
...
9+
LL | (a, b) //[krisskross]~ ERROR E0623
10+
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
1011

1112
error: unsatisfied lifetime constraints
12-
--> $DIR/project-fn-ret-invariant.rs:64:12
13+
--> $DIR/project-fn-ret-invariant.rs:65:4
1314
|
1415
LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
1516
| -- -- lifetime `'b` defined here
1617
| |
1718
| lifetime `'a` defined here
18-
LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623
19-
LL | let b = bar(foo, x);
20-
| ^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`
19+
...
20+
LL | (a, b) //[krisskross]~ ERROR E0623
21+
| ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
2122

2223
error: aborting due to 2 previous errors
2324

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ LL | bar(foo, x) //[transmute]~ ERROR E0495
88
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
99

1010
error: unsatisfied lifetime constraints
11-
--> $DIR/project-fn-ret-invariant.rs:58:13
11+
--> $DIR/project-fn-ret-invariant.rs:58:4
1212
|
1313
LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> {
1414
| -- -- lifetime `'b` defined here
1515
| |
1616
| lifetime `'a` defined here
1717
...
1818
LL | bar(foo, x) //[transmute]~ ERROR E0495
19-
| ^ requires that `'a` must outlive `'b`
19+
| ^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
2020

2121
error: aborting due to 2 previous errors
2222

src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ LL | move |_| println!("{}", y)
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
3737

3838
error[E0310]: the parameter type `T` may not live long enough
39-
--> $DIR/must_outlive_least_region_or_bound.rs:34:5
39+
--> $DIR/must_outlive_least_region_or_bound.rs:32:51
4040
|
41-
LL | x
42-
| ^
41+
LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
42+
| ^^^^^^^^^^^^^^^^^^^^
4343
|
4444
= help: consider adding an explicit lifetime bound `T: 'static`...
4545

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ 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-
| ^^^^^^ cast requires that `'1` must outlive `'static`
7+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
88
help: to allow this impl Trait to capture borrowed data with lifetime `'1`, add `'_` as a constraint
99
|
1010
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
@@ -16,7 +16,7 @@ error: unsatisfied lifetime constraints
1616
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
1717
| -- lifetime `'a` defined here
1818
LL | self.x.iter().map(|a| a.0)
19-
| ^^^^^^ cast requires that `'a` must outlive `'static`
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
2020
help: to allow this impl Trait to capture borrowed data with lifetime `'a`, add `'a` as a constraint
2121
|
2222
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {

src/test/ui/impl-trait/type_parameters_captured.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0310]: the parameter type `T` may not live long enough
2-
--> $DIR/type_parameters_captured.rs:19:5
2+
--> $DIR/type_parameters_captured.rs:17:20
33
|
4-
LL | x
5-
| ^
4+
LL | fn foo<T>(x: T) -> impl Any + 'static {
5+
| ^^^^^^^^^^^^^^^^^^
66
|
77
= help: consider adding an explicit lifetime bound `T: 'static`...
88

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/issue-10291.rs:12:5
2+
--> $DIR/issue-10291.rs:12:65
33
|
4-
LL | fn test<'x>(x: &'x isize) {
5-
| -- lifetime `'x` defined here
6-
LL | drop::<Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
7-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'x` must outlive `'static`
4+
LL | fn test<'x>(x: &'x isize) {
5+
| -- lifetime `'x` defined here
6+
LL | drop::<Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| {
7+
| _________________________________________________________________^
8+
LL | | x //~ ERROR E0312
9+
LL | | }));
10+
| |_____^ closure body requires that `'x` must outlive `'static`
811

912
error: aborting due to previous error
1013

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo(&mut (ref mut v, w): &mut (&u8, &u8), x: &u8) {
66
| |
77
| let's call the lifetime of this reference `'2`
88
LL | *v = x; //~ ERROR lifetime mismatch
9-
| ^^^^^^ requires that `'1` must outlive `'2`
9+
| ^^^^^^ assignment requires that `'1` must outlive `'2`
1010

1111
error: aborting due to previous error
1212

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo(mut x: Ref, y: Ref) {
66
| |
77
| has type `Ref<'_, '2>`
88
LL | x.b = y.b; //~ ERROR lifetime mismatch
9-
| ^^^^^^^^^ requires that `'1` must outlive `'2`
9+
| ^^^^^^^^^ assignment requires that `'1` must outlive `'2`
1010

1111
error: aborting due to previous error
1212

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn foo(mut x: Ref) {
77
| has type `Ref<'_, '1>`
88
| has type `Ref<'2, '_>`
99
LL | x.a = x.b; //~ ERROR lifetime mismatch
10-
| ^^^^^^^^^ requires that `'1` must outlive `'2`
10+
| ^^^^^^^^^ assignment requires that `'1` must outlive `'2`
1111

1212
error: aborting due to previous error
1313

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn foo(mut x: Ref) {
77
| has type `Ref<'_, '1>`
88
| has type `Ref<'2, '_>`
99
LL | x.a = x.b; //~ ERROR lifetime mismatch
10-
| ^^^^^^^^^ requires that `'1` must outlive `'2`
10+
| ^^^^^^^^^ assignment requires that `'1` must outlive `'2`
1111

1212
error: aborting due to previous error
1313

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo(mut x: Ref, y: &u32) {
66
| |
77
| has type `Ref<'_, '1>`
88
LL | y = x.b; //~ ERROR lifetime mismatch
9-
| ^^^^^^^ requires that `'1` must outlive `'2`
9+
| ^^^^^^^ assignment requires that `'1` must outlive `'2`
1010

1111
error[E0384]: cannot assign to immutable argument `y`
1212
--> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:5

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo(mut y: Ref, x: &u32) {
66
| |
77
| has type `Ref<'_, '2>`
88
LL | y.b = x; //~ ERROR lifetime mismatch
9-
| ^^^^^^^ requires that `'1` must outlive `'2`
9+
| ^^^^^^^ assignment requires that `'1` must outlive `'2`
1010

1111
error: aborting due to previous error
1212

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo(mut y: Ref, x: &u32) {
66
| |
77
| has type `Ref<'_, '2>`
88
LL | y.b = x; //~ ERROR lifetime mismatch
9-
| ^^^^^^^ requires that `'1` must outlive `'2`
9+
| ^^^^^^^ assignment requires that `'1` must outlive `'2`
1010

1111
error: aborting due to previous error
1212

src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn foo(mut x: Ref, y: &u32) {
66
| |
77
| has type `Ref<'_, '2>`
88
LL | x.b = y; //~ ERROR lifetime mismatch
9-
| ^^^^^^^ requires that `'1` must outlive `'2`
9+
| ^^^^^^^ assignment requires that `'1` must outlive `'2`
1010

1111
error: aborting due to previous error
1212

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error: unsatisfied lifetime constraints
1313
--> $DIR/escape-argument-callee.rs:36:45
1414
|
1515
LL | let mut closure = expect_sig(|p, y| *p = y);
16-
| - - ^^^^^^ requires that `'1` must outlive `'2`
16+
| - - ^^^^^^ assignment requires that `'1` must outlive `'2`
1717
| | |
1818
| | has type `&'1 i32`
1919
| has type `&mut &'2 i32`

src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,20 @@ LL | | }
3434
= note: defining type: DefId(0/0:6 ~ propagate_approximated_ref[317d]::supply[0]) with substs []
3535

3636
error: unsatisfied lifetime constraints
37-
--> $DIR/propagate-approximated-ref.rs:53:5
37+
--> $DIR/propagate-approximated-ref.rs:53:47
3838
|
3939
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
4040
| -- -- lifetime `'b` defined here
4141
| |
4242
| lifetime `'a` defined here
43-
LL | / establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
43+
LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
44+
| _______________________________________________^
4445
LL | | //~^ ERROR unsatisfied lifetime constraints
4546
LL | |
4647
LL | | // Only works if 'x: 'y:
4748
LL | | demand_y(x, y, x.get())
4849
LL | | });
49-
| |______^ argument requires that `'a` must outlive `'b`
50+
| |_____^ closure body requires that `'a` must outlive `'b`
5051

5152
error: aborting due to previous error
5253

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

+14-7
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,21 @@ LL | | });
4949
| |______^ `cell_a` escapes the function body here
5050

5151
error: unsatisfied lifetime constraints
52-
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:29
52+
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:47
5353
|
54-
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
55-
| -- -- lifetime `'b` defined here
56-
| |
57-
| lifetime `'a` defined here
58-
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
59-
| ^^^^^^^ requires that `'a` must outlive `'b`
54+
LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
55+
| -- -- lifetime `'b` defined here
56+
| |
57+
| lifetime `'a` defined here
58+
LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
59+
| _______________________________________________^
60+
LL | | //~^ ERROR borrowed data escapes outside of function
61+
LL | | //~| ERROR unsatisfied lifetime constraints
62+
LL | |
63+
LL | | // Only works if 'x: 'y:
64+
LL | | demand_y(x, y, x.get())
65+
LL | | });
66+
| |_____^ closure body requires that `'a` must outlive `'b`
6067

6168
error: aborting due to 2 previous errors
6269

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

+13-7
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,20 @@ LL | | });
4747
| |______^ `cell_a` escapes the function body here
4848

4949
error: unsatisfied lifetime constraints
50-
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:29
50+
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:47
5151
|
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, |_outlives1, _outlives2, x, y| {
57-
| ^^^^^^^ requires that `'a` must outlive `'b`
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, |_outlives1, _outlives2, x, y| {
57+
| _______________________________________________^
58+
LL | | //~^ ERROR borrowed data escapes outside of function
59+
LL | | //~| ERROR unsatisfied lifetime constraints
60+
LL | | // Only works if 'x: 'y:
61+
LL | | demand_y(x, y, x.get())
62+
LL | | });
63+
| |_____^ closure body requires that `'a` must outlive `'b`
5864

5965
error: aborting due to 2 previous errors
6066

src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,20 @@ LL | | }
3434
= note: defining type: DefId(0/0:6 ~ propagate_approximated_val[317d]::test[0]) with substs []
3535

3636
error: unsatisfied lifetime constraints
37-
--> $DIR/propagate-approximated-val.rs:46:5
37+
--> $DIR/propagate-approximated-val.rs:46:45
3838
|
3939
LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
4040
| -- -- lifetime `'b` defined here
4141
| |
4242
| lifetime `'a` defined here
43-
LL | / establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
43+
LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
44+
| _____________________________________________^
4445
LL | | //~^ ERROR unsatisfied lifetime constraints
4546
LL | |
4647
LL | | // Only works if 'x: 'y:
4748
LL | | demand_y(outlives1, outlives2, x.get())
4849
LL | | });
49-
| |______^ argument requires that `'a` must outlive `'b`
50+
| |_____^ closure body requires that `'a` must outlive `'b`
5051

5152
error: aborting due to previous error
5253

src/test/ui/nll/issue-50716.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error: borrowed data escapes outside of function
1+
error: unsatisfied lifetime constraints
22
--> $DIR/issue-50716.rs:25:14
33
|
44
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
5-
| - `s` is a reference that is only valid in the function body
5+
| -- lifetime `'a` defined here
66
...
77
LL | let _x = *s; //~ ERROR
8-
| ^^ `s` escapes the function body here
8+
| ^^ proving this value is `Sized` requires that `'a` must outlive `'static`
99

1010
error: aborting due to previous error
1111

src/test/ui/nll/issue-52113.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ fn produce3<'a, 'b: 'a>(data: &'a mut Vec<&'a u32>, value: &'b u32) -> impl Bazi
4040
}
4141

4242
fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
43-
let x = move || { //~ ERROR unsatisfied lifetime constraints
43+
let x = move || {
4444
let value: &'a u32 = value;
4545
data.push(value);
4646
};
47-
x
47+
x //~ ERROR unsatisfied lifetime constraints
4848
}
4949

5050
fn main() { }

src/test/ui/nll/issue-52113.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
error: unsatisfied lifetime constraints
2-
--> $DIR/issue-52113.rs:43:9
2+
--> $DIR/issue-52113.rs:47:5
33
|
44
LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b {
55
| -- -- lifetime `'b` defined here
66
| |
77
| lifetime `'a` defined here
8-
LL | let x = move || { //~ ERROR unsatisfied lifetime constraints
9-
| ^ requires that `'a` must outlive `'b`
8+
...
9+
LL | x //~ ERROR unsatisfied lifetime constraints
10+
| ^ returning this value requires that `'a` must outlive `'b`
1011

1112
error: aborting due to previous error
1213

src/test/ui/nll/issue-52742.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | fn take_bar(&mut self, b: Bar<'_>) {
66
| |
77
| has type `&mut Foo<'_, '2>`
88
LL | self.y = b.z
9-
| ^^^^^^^^^^^^ requires that `'1` must outlive `'2`
9+
| ^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2`
1010

1111
error: aborting due to previous error
1212

0 commit comments

Comments
 (0)