Skip to content

Commit 8d561d2

Browse files
committed
Bless tests
1 parent 53120b5 commit 8d561d2

16 files changed

+136
-66
lines changed

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
8282
error[E0310]: the parameter type `T` may not live long enough
8383
--> $DIR/must_outlive_least_region_or_bound.rs:41:5
8484
|
85+
LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
86+
| -- help: consider adding an explicit lifetime bound...: `T: 'static +`
87+
...
8588
LL | x
86-
| ^
87-
|
88-
= help: consider adding an explicit lifetime bound `T: 'static`...
89+
| ^ ...so that the type `T` will meet its required lifetime bounds
8990

9091
error: aborting due to 9 previous errors
9192

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/type_parameters_captured.rs:10:5
33
|
4+
LL | fn foo<T>(x: T) -> impl Any + 'static {
5+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
6+
...
47
LL | x
5-
| ^
6-
|
7-
= help: consider adding an explicit lifetime bound `T: 'static`...
8+
| ^ ...so that the type `T` will meet its required lifetime bounds
89

910
error: aborting due to previous error
1011

src/test/ui/lifetimes/lifetime-errors/issue_74400.nll.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/issue_74400.rs:12:5
33
|
4+
LL | fn g<T>(data: &[T]) {
5+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
46
LL | f(data, identity)
5-
| ^^^^^^^^^^^^^^^^^
6-
|
7-
= help: consider adding an explicit lifetime bound `T: 'static`...
7+
| ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
88

99
error[E0308]: mismatched types
1010
--> $DIR/issue_74400.rs:12:5

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | bar::<T::Output>()
55
| ^^^^^^^^^^^^^^^^
66
|
77
= help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
8+
= note: ...so that the type `<T as MyTrait<'_>>::Output` will meet its required lifetime bounds
89

910
error: aborting due to previous error
1011

src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.nll.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | bar::<<T as MyTrait<'a>>::Output>()
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
8+
= note: ...so that the type `<T as MyTrait<'_>>::Output` will meet its required lifetime bounds
89

910
error: aborting due to previous error
1011

src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | Box::new(item)
55
| ^^^^^^^^^^^^^^
66
|
77
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
8+
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
89

910
error[E0310]: the associated type `<T as Iter>::Item` may not live long enough
1011
--> $DIR/regions-close-associated-type-into-object.rs:22:5
@@ -13,6 +14,7 @@ LL | Box::new(item)
1314
| ^^^^^^^^^^^^^^
1415
|
1516
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
17+
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
1618

1719
error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
1820
--> $DIR/regions-close-associated-type-into-object.rs:28:5
@@ -21,6 +23,7 @@ LL | Box::new(item)
2123
| ^^^^^^^^^^^^^^
2224
|
2325
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
26+
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
2427

2528
error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
2629
--> $DIR/regions-close-associated-type-into-object.rs:35:5
@@ -29,6 +32,7 @@ LL | Box::new(item)
2932
| ^^^^^^^^^^^^^^
3033
|
3134
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
35+
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
3236

3337
error: aborting due to 4 previous errors
3438

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
error[E0310]: the parameter type `U` may not live long enough
22
--> $DIR/regions-close-object-into-object-4.rs:9:5
33
|
4+
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
5+
| - help: consider adding an explicit lifetime bound...: `U: 'static`
46
LL | Box::new(B(&*v)) as Box<dyn X>
5-
| ^^^^^^^^
6-
|
7-
= help: consider adding an explicit lifetime bound `U: 'static`...
7+
| ^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
88

99
error[E0310]: the parameter type `U` may not live long enough
1010
--> $DIR/regions-close-object-into-object-4.rs:9:5
1111
|
12+
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
13+
| - help: consider adding an explicit lifetime bound...: `U: 'static`
1214
LL | Box::new(B(&*v)) as Box<dyn X>
13-
| ^^^^^^^^^^^^^^^^
14-
|
15-
= help: consider adding an explicit lifetime bound `U: 'static`...
15+
| ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
1616

1717
error[E0310]: the parameter type `U` may not live long enough
1818
--> $DIR/regions-close-object-into-object-4.rs:9:5
1919
|
20+
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
21+
| - help: consider adding an explicit lifetime bound...: `U: 'static`
2022
LL | Box::new(B(&*v)) as Box<dyn X>
21-
| ^^^^^^^^^^^^^^^^
22-
|
23-
= help: consider adding an explicit lifetime bound `U: 'static`...
23+
| ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
2424

2525
error: lifetime may not live long enough
2626
--> $DIR/regions-close-object-into-object-4.rs:9:5
@@ -42,10 +42,10 @@ LL | Box::new(B(&*v)) as Box<dyn X>
4242
error[E0310]: the parameter type `U` may not live long enough
4343
--> $DIR/regions-close-object-into-object-4.rs:9:14
4444
|
45+
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
46+
| - help: consider adding an explicit lifetime bound...: `U: 'static`
4547
LL | Box::new(B(&*v)) as Box<dyn X>
46-
| ^^^^^^
47-
|
48-
= help: consider adding an explicit lifetime bound `U: 'static`...
48+
| ^^^^^^ ...so that the type `U` will meet its required lifetime bounds
4949

5050
error: aborting due to 6 previous errors
5151

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

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/regions-close-object-into-object-5.rs:17:5
33
|
4+
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
5+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
6+
LL | // oh dear!
47
LL | Box::new(B(&*v)) as Box<dyn X>
5-
| ^^^^^^^^
6-
|
7-
= help: consider adding an explicit lifetime bound `T: 'static`...
8+
| ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
89

910
error[E0310]: the parameter type `T` may not live long enough
1011
--> $DIR/regions-close-object-into-object-5.rs:17:5
1112
|
13+
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
14+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
15+
LL | // oh dear!
1216
LL | Box::new(B(&*v)) as Box<dyn X>
13-
| ^^^^^^^^^^^^^^^^
14-
|
15-
= help: consider adding an explicit lifetime bound `T: 'static`...
17+
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
1618

1719
error[E0310]: the parameter type `T` may not live long enough
1820
--> $DIR/regions-close-object-into-object-5.rs:17:5
1921
|
22+
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
23+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
24+
LL | // oh dear!
2025
LL | Box::new(B(&*v)) as Box<dyn X>
21-
| ^^^^^^^^^^^^^^^^
22-
|
23-
= help: consider adding an explicit lifetime bound `T: 'static`...
26+
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
2427

2528
error[E0515]: cannot return value referencing local data `*v`
2629
--> $DIR/regions-close-object-into-object-5.rs:17:5
@@ -34,10 +37,11 @@ LL | Box::new(B(&*v)) as Box<dyn X>
3437
error[E0310]: the parameter type `T` may not live long enough
3538
--> $DIR/regions-close-object-into-object-5.rs:17:14
3639
|
40+
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
41+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
42+
LL | // oh dear!
3743
LL | Box::new(B(&*v)) as Box<dyn X>
38-
| ^^^^^^
39-
|
40-
= help: consider adding an explicit lifetime bound `T: 'static`...
44+
| ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
4145

4246
error: aborting due to 5 previous errors
4347

src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error[E0310]: the parameter type `A` may not live long enough
22
--> $DIR/regions-close-over-type-parameter-1.rs:12:5
33
|
4+
LL | fn make_object1<A: SomeTrait>(v: A) -> Box<dyn SomeTrait + 'static> {
5+
| -- help: consider adding an explicit lifetime bound...: `A: 'static +`
46
LL | Box::new(v) as Box<dyn SomeTrait + 'static>
5-
| ^^^^^^^^^^^
6-
|
7-
= help: consider adding an explicit lifetime bound `A: 'static`...
7+
| ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
88

99
error[E0309]: the parameter type `A` may not live long enough
1010
--> $DIR/regions-close-over-type-parameter-1.rs:21:5
1111
|
12+
LL | fn make_object3<'a, 'b, A: SomeTrait + 'a>(v: A) -> Box<dyn SomeTrait + 'b> {
13+
| -- help: consider adding an explicit lifetime bound...: `A: 'b +`
1214
LL | Box::new(v) as Box<dyn SomeTrait + 'b>
13-
| ^^^^^^^^^^^
14-
|
15-
= help: consider adding an explicit lifetime bound `A: 'b`...
15+
| ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
1616

1717
error: aborting due to 2 previous errors
1818

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

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/regions-close-param-into-object.rs:6:5
33
|
4+
LL | fn p1<T>(v: T) -> Box<dyn X + 'static>
5+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
6+
...
47
LL | Box::new(v)
5-
| ^^^^^^^^^^^
6-
|
7-
= help: consider adding an explicit lifetime bound `T: 'static`...
8+
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
89

910
error[E0310]: the parameter type `T` may not live long enough
1011
--> $DIR/regions-close-param-into-object.rs:12:5
1112
|
13+
LL | fn p2<T>(v: Box<T>) -> Box<dyn X + 'static>
14+
| - help: consider adding an explicit lifetime bound...: `T: 'static`
15+
...
1216
LL | Box::new(v)
13-
| ^^^^^^^^^^^
14-
|
15-
= help: consider adding an explicit lifetime bound `T: 'static`...
17+
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
1618

1719
error[E0309]: the parameter type `T` may not live long enough
1820
--> $DIR/regions-close-param-into-object.rs:18:5
1921
|
22+
LL | fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
23+
| - help: consider adding an explicit lifetime bound...: `T: 'a`
24+
...
2025
LL | Box::new(v)
21-
| ^^^^^^^^^^^
22-
|
23-
= help: consider adding an explicit lifetime bound `T: 'a`...
26+
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
2427

2528
error[E0309]: the parameter type `T` may not live long enough
2629
--> $DIR/regions-close-param-into-object.rs:24:5
2730
|
31+
LL | fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
32+
| - help: consider adding an explicit lifetime bound...: `T: 'a`
33+
...
2834
LL | Box::new(v)
29-
| ^^^^^^^^^^^
30-
|
31-
= help: consider adding an explicit lifetime bound `T: 'a`...
35+
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
3236

3337
error: aborting due to 4 previous errors
3438

src/test/ui/regions/regions-implied-bounds-projection-gap-1.nll.stderr

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
error[E0309]: the parameter type `T` may not live long enough
22
--> $DIR/regions-implied-bounds-projection-gap-1.rs:16:5
33
|
4+
LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo)
5+
| -- help: consider adding an explicit lifetime bound...: `T: 'x +`
6+
LL | {
47
LL | wf::<&'x T>();
5-
| ^^^^^^^^^^^
6-
|
7-
= help: consider adding an explicit lifetime bound `T: 'x`...
8+
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
89

910
error: aborting due to previous error
1011

src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | check_bound(x, self)
55
| ^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: consider adding an explicit lifetime bound `Self: 'a`...
8+
= note: ...so that the type `Self` will meet its required lifetime bounds
89

910
error: aborting due to previous error
1011

src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error[E0309]: the parameter type `A` may not live long enough
22
--> $DIR/regions-infer-bound-from-trait.rs:33:5
33
|
4+
LL | fn bar1<'a,A>(x: Inv<'a>, a: A) {
5+
| - help: consider adding an explicit lifetime bound...: `A: 'a`
46
LL | check_bound(x, a)
5-
| ^^^^^^^^^^^^^^^^^
6-
|
7-
= help: consider adding an explicit lifetime bound `A: 'a`...
7+
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
88

99
error[E0309]: the parameter type `A` may not live long enough
1010
--> $DIR/regions-infer-bound-from-trait.rs:37:5
1111
|
12+
LL | fn bar2<'a,'b,A:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
13+
| -- help: consider adding an explicit lifetime bound...: `A: 'a +`
1214
LL | check_bound(x, a)
13-
| ^^^^^^^^^^^^^^^^^
14-
|
15-
= help: consider adding an explicit lifetime bound `A: 'a`...
15+
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
1616

1717
error: aborting due to 2 previous errors
1818

src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
error[E0311]: the parameter type `T` may not live long enough
22
--> $DIR/missing-lifetimes-in-signature-2.rs:20:5
33
|
4+
LL | fn func<T: Test>(foo: &Foo, t: T) {
5+
| -- help: consider adding an explicit lifetime bound...: `T: 'a +`
46
LL | / foo.bar(move |_| {
57
LL | |
68
LL | | t.test();
@@ -12,6 +14,14 @@ note: the parameter type `T` must be valid for the anonymous lifetime defined he
1214
|
1315
LL | fn func<T: Test>(foo: &Foo, t: T) {
1416
| ^^^
17+
note: ...so that the type `T` will meet its required lifetime bounds
18+
--> $DIR/missing-lifetimes-in-signature-2.rs:20:5
19+
|
20+
LL | / foo.bar(move |_| {
21+
LL | |
22+
LL | | t.test();
23+
LL | | });
24+
| |______^
1525

1626
error: aborting due to previous error
1727

0 commit comments

Comments
 (0)