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
Lines changed: 8 additions & 7 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 7 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 8 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)