Skip to content

Commit 03bbb98

Browse files
committed
Bless tests.
1 parent 94449e6 commit 03bbb98

File tree

68 files changed

+527
-298
lines changed

Some content is hidden

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

68 files changed

+527
-298
lines changed

src/test/ui/async-await/issue-86507.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ note: captured value is not `Send` because `&` references cannot be sent unless
1414
LL | let x = x;
1515
| ^ has type `&T` which is not `Send`, because `T` is not `Sync`
1616
= note: required for the cast to the object type `dyn Future<Output = ()> + Send`
17-
help: consider further restricting type parameter `T`
17+
help: consider further restricting this bound
1818
|
19-
LL | where 'me:'async_trait, T: std::marker::Sync {
20-
| ++++++++++++++++++++++
19+
LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T)
20+
| +++++++++++++++++++
2121

2222
error: aborting due to previous error
2323

src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/builtin-superkinds-self-type.rs:10:16
33
|
44
LL | impl <T: Sync> Foo for T { }
5-
| -- ^^^ ...so that the type `T` will meet its required lifetime bounds
6-
| |
7-
| help: consider adding an explicit lifetime bound...: `T: 'static +`
5+
| ^^^ ...so that the type `T` will meet its required lifetime bounds
6+
|
7+
help: consider adding an explicit lifetime bound...
8+
|
9+
LL | impl <T: Sync + 'static> Foo for T { }
10+
| +++++++++
811

912
error: aborting due to previous error
1013

src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
error[E0310]: the parameter type `U` may not live long enough
22
--> $DIR/feature-gate-infer_static_outlives_requirements.rs:5:10
33
|
4-
LL | struct Foo<U> {
5-
| - help: consider adding an explicit lifetime bound...: `U: 'static`
64
LL | bar: Bar<U>
75
| ^^^^^^ ...so that the type `U` will meet its required lifetime bounds...
86
|
@@ -11,6 +9,10 @@ note: ...that is required by this bound
119
|
1210
LL | struct Bar<T: 'static> {
1311
| ^^^^^^^
12+
help: consider adding an explicit lifetime bound...
13+
|
14+
LL | struct Foo<U: 'static> {
15+
| +++++++++
1416

1517
error: aborting due to previous error
1618

src/test/ui/generic-associated-types/issue-86483.stderr

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
error[E0311]: the parameter type `T` may not live long enough
22
--> $DIR/issue-86483.rs:5:1
33
|
4-
LL | pub trait IceIce<T>
5-
| ^ - help: consider adding an explicit lifetime bound...: `T: 'a`
6-
| _|
7-
| |
4+
LL | / pub trait IceIce<T>
85
LL | | where
96
LL | | for<'a> T: 'a,
107
LL | | {
@@ -19,13 +16,14 @@ note: ...that is required by this bound
1916
|
2017
LL | for<'a> T: 'a,
2118
| ^^
19+
help: consider adding an explicit lifetime bound...
20+
|
21+
LL | for<'a> T: 'a + 'a,
22+
| ++++
2223

2324
error[E0311]: the parameter type `T` may not live long enough
2425
--> $DIR/issue-86483.rs:9:5
2526
|
26-
LL | pub trait IceIce<T>
27-
| - help: consider adding an explicit lifetime bound...: `T: 'a`
28-
...
2927
LL | type Ice<'v>: IntoIterator<Item = &'v T>;
3028
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
3129
|
@@ -34,6 +32,10 @@ note: ...that is required by this bound
3432
|
3533
LL | for<'a> T: 'a,
3634
| ^^
35+
help: consider adding an explicit lifetime bound...
36+
|
37+
LL | for<'a> T: 'a + 'a,
38+
| ++++
3739

3840
error[E0309]: the parameter type `T` may not live long enough
3941
--> $DIR/issue-86483.rs:9:32
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
error[E0311]: the parameter type `T` may not live long enough
22
--> $DIR/issue-91139.rs:27:12
33
|
4-
LL | fn foo<T>() {
5-
| - help: consider adding an explicit lifetime bound...: `T: 'a`
64
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
75
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
6+
|
7+
help: consider adding an explicit lifetime bound...
8+
|
9+
LL | fn foo<T: 'a>() {
10+
| ++++
811

912
error: aborting due to previous error
1013

src/test/ui/generic-associated-types/issue-92096.migrate.stderr

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ error[E0311]: the parameter type `C` may not live long enough
22
--> $DIR/issue-92096.rs:20:33
33
|
44
LL | fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
5-
| - ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds
6-
| |
7-
| help: consider adding an explicit lifetime bound...: `C: 'a`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds
6+
|
7+
help: consider adding an explicit lifetime bound...
8+
|
9+
LL | C: Client + Send + Sync + 'a,
10+
| ++++
811

912
error[E0311]: the parameter type `C` may not live long enough
1013
--> $DIR/issue-92096.rs:20:33
1114
|
1215
LL | fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
13-
| - ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds
14-
| |
15-
| help: consider adding an explicit lifetime bound...: `C: 'a`
16+
| ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds
17+
|
18+
help: consider adding an explicit lifetime bound...
19+
|
20+
LL | C: Client + Send + Sync + 'a,
21+
| ++++
1622

1723
error: aborting due to 2 previous errors
1824

src/test/ui/generic-associated-types/missing-bounds.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ note: tuple struct defined here
8787
|
8888
LL | struct E<B>(B);
8989
| ^
90-
help: consider further restricting type parameter `B`
90+
help: consider further restricting this bound
9191
|
92-
LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B, B: Add<Output = B> {
93-
| ++++++++++++++++++++
92+
LL | impl<B: Add + Add<Output = B>> Add for E<B> where <B as Add>::Output = B {
93+
| +++++++++++++++++
9494

9595
error: aborting due to 5 previous errors
9696

src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ warning: unnecessary lifetime parameter `'a`
22
--> $DIR/unsatified-item-lifetime-bound.rs:4:12
33
|
44
LL | type Y<'a: 'static>;
5-
| ^^^^^^^^^^^
5+
| ^^
66
|
77
= help: you can use the `'static` lifetime directly, in place of `'a`
88

src/test/ui/impl-trait/equal-hidden-lifetimes.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ warning: unnecessary lifetime parameter `'a`
22
--> $DIR/equal-hidden-lifetimes.rs:7:25
33
|
44
LL | fn equal_regions_static<'a: 'static>(x: &'a i32) -> impl Sized {
5-
| ^^^^^^^^^^^
5+
| ^^
66
|
77
= help: you can use the `'static` lifetime directly, in place of `'a`
88

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,12 @@ error[E0310]: the parameter type `T` may not live long enough
128128
--> $DIR/must_outlive_least_region_or_bound.rs:38:51
129129
|
130130
LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
131-
| -- ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
132-
| |
133-
| help: consider adding an explicit lifetime bound...: `T: 'static +`
131+
| ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
132+
|
133+
help: consider adding an explicit lifetime bound...
134+
|
135+
LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 'static {
136+
| +++++++++
134137

135138
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
136139
--> $DIR/must_outlive_least_region_or_bound.rs:16:50

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/type_parameters_captured.rs:7:20
33
|
44
LL | fn foo<T>(x: T) -> impl Any + 'static {
5-
| - ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
6-
| |
7-
| help: consider adding an explicit lifetime bound...: `T: 'static`
5+
| ^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
6+
|
7+
help: consider adding an explicit lifetime bound...
8+
|
9+
LL | fn foo<T: 'static>(x: T) -> impl Any + 'static {
10+
| +++++++++
811

912
error: aborting due to previous error
1013

src/test/ui/issues/issue-30438-c.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ trait Trait { type Out; }
55
struct Test<'a> { s: &'a str }
66

77
fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y <Test<'z> as Trait>::Out where 'z: 'static {
8+
//~^ WARN unnecessary lifetime parameter `'z`
89
let x = Test { s: "this cannot last" };
910
&x
1011
//~^ ERROR: cannot return reference to local variable `x`
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
warning: unnecessary lifetime parameter `'z`
2+
--> $DIR/issue-30438-c.rs:7:74
3+
|
4+
LL | fn silly<'y, 'z>(_s: &'y Test<'z>) -> &'y <Test<'z> as Trait>::Out where 'z: 'static {
5+
| ^^
6+
|
7+
= help: you can use the `'static` lifetime directly, in place of `'z`
8+
19
error[E0515]: cannot return reference to local variable `x`
2-
--> $DIR/issue-30438-c.rs:9:5
10+
--> $DIR/issue-30438-c.rs:10:5
311
|
412
LL | &x
513
| ^^ returns a reference to data owned by the current function
614

7-
error: aborting due to previous error
15+
error: aborting due to previous error; 1 warning emitted
816

917
For more information about this error, try `rustc --explain E0515`.

src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/lifetime-doesnt-live-long-enough.rs:19:10
33
|
4-
LL | struct Foo<T> {
5-
| - help: consider adding an explicit lifetime bound...: `T: 'static`
64
LL | foo: &'static T
75
| ^^^^^^^^^^ ...so that the reference type `&'static T` does not outlive the data it points at
6+
|
7+
help: consider adding an explicit lifetime bound...
8+
|
9+
LL | struct Foo<T: 'static> {
10+
| +++++++++
811

912
error[E0309]: the parameter type `K` may not live long enough
1013
--> $DIR/lifetime-doesnt-live-long-enough.rs:24:19
1114
|
12-
LL | trait X<K>: Sized {
13-
| - help: consider adding an explicit lifetime bound...: `K: 'a`
1415
LL | fn foo<'a, L: X<&'a Nested<K>>>();
1516
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
17+
|
18+
help: consider adding an explicit lifetime bound...
19+
|
20+
LL | trait X<K: 'a>: Sized {
21+
| ++++
1622

1723
error[E0309]: the parameter type `Self` may not live long enough
1824
--> $DIR/lifetime-doesnt-live-long-enough.rs:28:19
@@ -27,25 +33,34 @@ error[E0309]: the parameter type `L` may not live long enough
2733
--> $DIR/lifetime-doesnt-live-long-enough.rs:32:22
2834
|
2935
LL | fn baz<'a, L, M: X<&'a Nested<L>>>() {
30-
| - ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
31-
| |
32-
| help: consider adding an explicit lifetime bound...: `L: 'a`
36+
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<L>` does not outlive the data it points at
37+
|
38+
help: consider adding an explicit lifetime bound...
39+
|
40+
LL | fn baz<'a, L: 'a, M: X<&'a Nested<L>>>() {
41+
| ++++
3342

3443
error[E0309]: the parameter type `K` may not live long enough
3544
--> $DIR/lifetime-doesnt-live-long-enough.rs:41:33
3645
|
37-
LL | impl<K> Nested<K> {
38-
| - help: consider adding an explicit lifetime bound...: `K: 'a`
3946
LL | fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
4047
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<K>` does not outlive the data it points at
48+
|
49+
help: consider adding an explicit lifetime bound...
50+
|
51+
LL | impl<K: 'a> Nested<K> {
52+
| ++++
4153

4254
error[E0309]: the parameter type `M` may not live long enough
4355
--> $DIR/lifetime-doesnt-live-long-enough.rs:44:36
4456
|
4557
LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
46-
| ^^^^^^^^^^^^^^^^ -- help: consider adding an explicit lifetime bound...: `M: 'a +`
47-
| |
48-
| ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
58+
| ^^^^^^^^^^^^^^^^ ...so that the reference type `&'a Nested<M>` does not outlive the data it points at
59+
|
60+
help: consider adding an explicit lifetime bound...
61+
|
62+
LL | fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b + 'a>() {
63+
| ++++
4964

5065
error: aborting due to 6 previous errors
5166

src/test/ui/moves/use_of_moved_value_copy_suggestions.fixed

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,31 +54,31 @@ where
5454

5555
fn duplicate_custom_3<T>(t: S<T>) -> (S<T>, S<T>)
5656
where
57-
T: A,
58-
T: B, T: Trait, T: Copy
59-
//~^ HELP consider further restricting type parameter `T`
57+
T: A + Trait + Copy,
58+
//~^ HELP consider further restricting this bound
59+
T: B,
6060
{
6161
(t, t) //~ use of moved value: `t`
6262
}
6363

64-
fn duplicate_custom_4<T: A>(t: S<T>) -> (S<T>, S<T>)
64+
fn duplicate_custom_4<T: A + Trait + Copy>(t: S<T>) -> (S<T>, S<T>)
65+
//~^ HELP consider further restricting this bound
6566
where
66-
T: B + Trait + Copy,
67-
//~^ HELP consider further restricting this bound
67+
T: B,
6868
{
6969
(t, t) //~ use of moved value: `t`
7070
}
7171

7272
#[rustfmt::skip]
73-
fn existing_colon<T: Copy>(t: T) {
73+
fn existing_colon<T: Copy:>(t: T) {
7474
//~^ HELP consider restricting type parameter `T`
7575
[t, t]; //~ use of moved value: `t`
7676
}
7777

7878
fn existing_colon_in_where<T>(t: T)
7979
where
80-
T: Copy,
81-
//~^ HELP consider further restricting this bound
80+
T:, T: Copy
81+
//~^ HELP consider further restricting type parameter `T`
8282
{
8383
[t, t]; //~ use of moved value: `t`
8484
}

src/test/ui/moves/use_of_moved_value_copy_suggestions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ where
5555
fn duplicate_custom_3<T>(t: S<T>) -> (S<T>, S<T>)
5656
where
5757
T: A,
58+
//~^ HELP consider further restricting this bound
5859
T: B,
59-
//~^ HELP consider further restricting type parameter `T`
6060
{
6161
(t, t) //~ use of moved value: `t`
6262
}
6363

6464
fn duplicate_custom_4<T: A>(t: S<T>) -> (S<T>, S<T>)
65+
//~^ HELP consider further restricting this bound
6566
where
6667
T: B,
67-
//~^ HELP consider further restricting this bound
6868
{
6969
(t, t) //~ use of moved value: `t`
7070
}
@@ -78,7 +78,7 @@ fn existing_colon<T:>(t: T) {
7878
fn existing_colon_in_where<T>(t: T)
7979
where
8080
T:,
81-
//~^ HELP consider further restricting this bound
81+
//~^ HELP consider further restricting type parameter `T`
8282
{
8383
[t, t]; //~ use of moved value: `t`
8484
}

0 commit comments

Comments
 (0)