Skip to content

Commit b4e3e62

Browse files
committed
Bless nll tests.
1 parent 39c67b2 commit b4e3e62

6 files changed

+45
-28
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
112112
error[E0310]: the parameter type `T` may not live long enough
113113
--> $DIR/must_outlive_least_region_or_bound.rs:40:5
114114
|
115-
LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
116-
| -- help: consider adding an explicit lifetime bound...: `T: 'static +`
117-
LL |
118115
LL | x
119116
| ^ ...so that the type `T` will meet its required lifetime bounds
117+
|
118+
help: consider adding an explicit lifetime bound...
119+
|
120+
LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 'static {
121+
| +++++++++
120122

121123
error: aborting due to 9 previous errors
122124

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
error[E0310]: the parameter type `T` may not live long enough
22
--> $DIR/type_parameters_captured.rs:9:5
33
|
4-
LL | fn foo<T>(x: T) -> impl Any + 'static {
5-
| - help: consider adding an explicit lifetime bound...: `T: 'static`
6-
LL |
74
LL | x
85
| ^ ...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+
| +++++++++
911

1012
error: aborting due to previous error
1113

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
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`
64
LL | f(data, identity)
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 g<T: 'static>(data: &[T]) {
10+
| +++++++++
811

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

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
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 +`
64
LL | / foo.bar(move |_| {
75
LL | |
86
LL | | t.test();
@@ -22,6 +20,10 @@ LL | |
2220
LL | | t.test();
2321
LL | | });
2422
| |______^
23+
help: consider adding an explicit lifetime bound...
24+
|
25+
LL | fn func<T: Test + 'a>(foo: &Foo, t: T) {
26+
| ++++
2527

2628
error: aborting due to previous error
2729

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

+21-15
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
2626
error[E0311]: the parameter type `G` may not live long enough
2727
--> $DIR/missing-lifetimes-in-signature.rs:31:5
2828
|
29-
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
30-
| - help: consider adding an explicit lifetime bound...: `G: 'a`
31-
...
3229
LL | / move || {
3330
LL | | *dest = g.get();
3431
LL | | }
@@ -46,13 +43,14 @@ LL | / move || {
4643
LL | | *dest = g.get();
4744
LL | | }
4845
| |_____^
46+
help: consider adding an explicit lifetime bound...
47+
|
48+
LL | G: Get<T> + 'a,
49+
| ++++
4950

5051
error[E0311]: the parameter type `G` may not live long enough
5152
--> $DIR/missing-lifetimes-in-signature.rs:53:5
5253
|
53-
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
54-
| -- help: consider adding an explicit lifetime bound...: `G: 'b +`
55-
...
5654
LL | / move || {
5755
LL | | *dest = g.get();
5856
LL | | }
@@ -70,13 +68,14 @@ LL | / move || {
7068
LL | | *dest = g.get();
7169
LL | | }
7270
| |_____^
71+
help: consider adding an explicit lifetime bound...
72+
|
73+
LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
74+
| ++++
7375

7476
error[E0311]: the parameter type `G` may not live long enough
7577
--> $DIR/missing-lifetimes-in-signature.rs:62:9
7678
|
77-
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
78-
| -- help: consider adding an explicit lifetime bound...: `G: 'c +`
79-
LL |
8079
LL | / move || {
8180
LL | | *dest = g.get();
8281
LL | | }
@@ -94,13 +93,14 @@ LL | / move || {
9493
LL | | *dest = g.get();
9594
LL | | }
9695
| |_________^
96+
help: consider adding an explicit lifetime bound...
97+
|
98+
LL | fn qux<'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
99+
| ++++
97100

98101
error[E0311]: the parameter type `G` may not live long enough
99102
--> $DIR/missing-lifetimes-in-signature.rs:74:5
100103
|
101-
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
102-
| -- help: consider adding an explicit lifetime bound...: `G: 'b +`
103-
...
104104
LL | / move || {
105105
LL | | *dest = g.get();
106106
LL | | }
@@ -118,6 +118,10 @@ LL | / move || {
118118
LL | | *dest = g.get();
119119
LL | | }
120120
| |_____^
121+
help: consider adding an explicit lifetime bound...
122+
|
123+
LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
124+
| ++++
121125

122126
error[E0621]: explicit lifetime required in the type of `dest`
123127
--> $DIR/missing-lifetimes-in-signature.rs:74:5
@@ -133,13 +137,15 @@ LL | | }
133137
error[E0309]: the parameter type `G` may not live long enough
134138
--> $DIR/missing-lifetimes-in-signature.rs:85:5
135139
|
136-
LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
137-
| - help: consider adding an explicit lifetime bound...: `G: 'a`
138-
...
139140
LL | / move || {
140141
LL | | *dest = g.get();
141142
LL | | }
142143
| |_____^ ...so that the type `G` will meet its required lifetime bounds
144+
|
145+
help: consider adding an explicit lifetime bound...
146+
|
147+
LL | G: Get<T> + 'a,
148+
| ++++
143149

144150
error: aborting due to 8 previous errors
145151

src/test/ui/suggestions/suggest-impl-trait-lifetime.nll.stderr

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
error[E0310]: the parameter type `impl Debug` may not live long enough
22
--> $DIR/suggest-impl-trait-lifetime.rs:7:5
33
|
4-
LL | fn foo(d: impl Debug) {
5-
| ---------- help: consider adding an explicit lifetime bound...: `impl Debug + 'static`
6-
LL |
74
LL | bar(d);
85
| ^^^^^^ ...so that the type `impl Debug` will meet its required lifetime bounds
6+
|
7+
help: consider adding an explicit lifetime bound...
8+
|
9+
LL | fn foo(d: impl Debug + 'static) {
10+
| +++++++++
911

1012
error: aborting due to previous error
1113

0 commit comments

Comments
 (0)