Skip to content

Commit 49b0a1e

Browse files
committed
#52413: addressed @estebank's Nit
1 parent 1940108 commit 49b0a1e

File tree

39 files changed

+44
-42
lines changed

39 files changed

+44
-42
lines changed

src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
113113
error_var
114114
).span_suggestion(
115115
new_ty_span,
116-
&format!("consider changing {} to ", span_label_var),
116+
&format!("add explicit lifetime `{}` to {}", named, span_label_var),
117117
new_ty.to_string()
118118
)
119119
.span_label(span, format!("lifetime `{}` required", named))

src/test/ui/in-band-lifetimes/mismatched.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ error[E0621]: explicit lifetime required in the type of `y`
1616
LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
1717
| ---- ^ lifetime `'a` required
1818
| |
19-
| help: consider changing the type of `y` to : `&'a u32`
19+
| help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
2020

2121
error[E0623]: lifetime mismatch
2222
--> $DIR/mismatched.rs:16:46

src/test/ui/in-band-lifetimes/mismatched.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0621]: explicit lifetime required in the type of `y`
44
LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
55
| ---- ^ lifetime `'a` required
66
| |
7-
| help: consider changing the type of `y` to : `&'a u32`
7+
| help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
88

99
error[E0623]: lifetime mismatch
1010
--> $DIR/mismatched.rs:16:46

src/test/ui/in-band-lifetimes/mismatched_trait.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
88
--> $DIR/mismatched_trait.rs:16:9
99
|
1010
LL | fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
11-
| ---- help: consider changing the type of `y` to : `&'a u32`
11+
| ---- help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
1212
LL | y //~ ERROR explicit lifetime required
1313
| ^ lifetime `'a` required
1414

src/test/ui/in-band-lifetimes/mismatched_trait.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
22
--> $DIR/mismatched_trait.rs:16:9
33
|
44
LL | fn baz(&self, x: &'a u32, y: &u32) -> &'a u32 {
5-
| ---- help: consider changing the type of `y` to : `&'a u32`
5+
| ---- help: add explicit lifetime `'a` to the type of `y`: `&'a u32`
66
LL | y //~ ERROR explicit lifetime required
77
| ^ lifetime `'a` required
88

src/test/ui/issue-13058.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `cont`
22
--> $DIR/issue-13058.rs:24:26
33
|
44
LL | fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
5-
| -- help: consider changing the type of `cont` to : `&'r T`
5+
| -- help: add explicit lifetime `'r` to the type of `cont`: `&'r T`
66
LL | {
77
LL | let cont_iter = cont.iter();
88
| ^^^^ lifetime `'r` required

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `a`
88
--> $DIR/issue-14285.rs:22:7
99
|
1010
LL | fn foo<'a>(a: &Foo) -> B<'a> {
11-
| ---- help: consider changing the type of `a` to : `&'a (dyn Foo + 'a)`
11+
| ---- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
1212
LL | B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
1313
| ^ lifetime `'a` required
1414

src/test/ui/issue-14285.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `a`
22
--> $DIR/issue-14285.rs:22:5
33
|
44
LL | fn foo<'a>(a: &Foo) -> B<'a> {
5-
| ---- help: consider changing the type of `a` to : `&'a (dyn Foo + 'a)`
5+
| ---- help: add explicit lifetime `'a` to the type of `a`: `&'a (dyn Foo + 'a)`
66
LL | B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
77
| ^^^^ lifetime `'a` required
88

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `lexer`
88
--> $DIR/issue-15034.rs:27:25
99
|
1010
LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
11-
| ------------- help: consider changing the type of `lexer` to : `&'a mut Lexer<'a>`
11+
| ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
1212
LL | Parser { lexer: lexer }
1313
| ^^^^^ lifetime `'a` required
1414

src/test/ui/issue-15034.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `lexer`
22
--> $DIR/issue-15034.rs:27:25
33
|
44
LL | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
5-
| ------------- help: consider changing the type of `lexer` to : `&'a mut Lexer<'a>`
5+
| ------------- help: add explicit lifetime `'a` to the type of `lexer`: `&'a mut Lexer<'a>`
66
LL | Parser { lexer: lexer }
77
| ^^^^^ lifetime `'a` required
88

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `value`
88
--> $DIR/issue-16922.rs:14:5
99
|
1010
LL | fn foo<T: Any>(value: &T) -> Box<Any> {
11-
| -- help: consider changing the type of `value` to : `&'static T`
11+
| -- help: add explicit lifetime `'static` to the type of `value`: `&'static T`
1212
LL | Box::new(value) as Box<Any>
1313
| ^^^^^^^^^^^^^^^ lifetime `'static` required
1414

src/test/ui/issue-16922.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `value`
22
--> $DIR/issue-16922.rs:14:5
33
|
44
LL | fn foo<T: Any>(value: &T) -> Box<Any> {
5-
| -- help: consider changing the type of `value` to : `&'static T`
5+
| -- help: add explicit lifetime `'static` to the type of `value`: `&'static T`
66
LL | Box::new(value) as Box<Any>
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required
88

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error[E0621]: explicit lifetime required in the type of `x`
1414
--> $DIR/issue-3154.rs:16:15
1515
|
1616
LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
17-
| -- help: consider changing the type of `x` to : `&'a Q`
17+
| -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
1818
LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
1919
| ^ lifetime `'a` required
2020

src/test/ui/issue-3154.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
22
--> $DIR/issue-3154.rs:16:5
33
|
44
LL | fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
5-
| -- help: consider changing the type of `x` to : `&'a Q`
5+
| -- help: add explicit lifetime `'a` to the type of `x`: `&'a Q`
66
LL | thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
77
| ^^^^^^^^^^^^^ lifetime `'a` required
88

src/test/ui/issue-40288-2.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ error[E0621]: explicit lifetime required in the type of `y`
3838
--> $DIR/issue-40288-2.rs:17:9
3939
|
4040
LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
41-
| -- help: consider changing the type of `y` to : `&'a T`
41+
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
4242
...
4343
LL | slice[0] = y;
4444
| ^^^^^^^^^^^^ lifetime `'a` required
@@ -47,7 +47,7 @@ error[E0621]: explicit lifetime required in the type of `y`
4747
--> $DIR/issue-40288-2.rs:32:9
4848
|
4949
LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
50-
| -- help: consider changing the type of `y` to : `&'a T`
50+
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
5151
...
5252
LL | dst.head = y;
5353
| ^^^^^^^^^^^^ lifetime `'a` required

src/test/ui/issue-40288-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
22
--> $DIR/issue-40288-2.rs:19:5
33
|
44
LL | fn lifetime_transmute_slice<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
5-
| -- help: consider changing the type of `y` to : `&'a T`
5+
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
66
...
77
LL | out[0]
88
| ^^^^^^ lifetime `'a` required
@@ -11,7 +11,7 @@ error[E0621]: explicit lifetime required in the type of `y`
1111
--> $DIR/issue-40288-2.rs:34:5
1212
|
1313
LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
14-
| -- help: consider changing the type of `y` to : `&'a T`
14+
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
1515
...
1616
LL | out.head
1717
| ^^^^^^^^ lifetime `'a` required

src/test/ui/issue-46983.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
22
--> $DIR/issue-46983.rs:14:5
33
|
44
LL | fn foo(x: &u32) -> &'static u32 {
5-
| ---- help: consider changing the type of `x` to : `&'static u32`
5+
| ---- help: add explicit lifetime `'static` to the type of `x`: `&'static u32`
66
LL | &*x
77
| ^^^ lifetime `'static` required
88

src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
88
--> $DIR/42701_one_named_and_one_anonymous.rs:16:5
99
|
1010
LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
11-
| ---- help: consider changing the type of `x` to : `&'a i32`
11+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
1212
LL | / if true {
1313
LL | | let p: &i32 = &a.field;
1414
LL | | &*p

src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
22
--> $DIR/42701_one_named_and_one_anonymous.rs:20:9
33
|
44
LL | fn foo2<'a>(a: &'a Foo, x: &i32) -> &'a i32 {
5-
| ---- help: consider changing the type of `x` to : `&'a i32`
5+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
66
...
77
LL | &*x //~ ERROR explicit lifetime
88
| ^^^ lifetime `'a` required

src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `other`
88
--> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:18:15
99
|
1010
LL | fn bar(&self, other: Foo) -> Foo<'a> {
11-
| --- help: consider changing the type of `other` to : `Foo<'a>`
11+
| --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
1212
LL | match *self {
1313
| ^^^^^ lifetime `'a` required
1414

src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `other`
22
--> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21
33
|
44
LL | fn bar(&self, other: Foo) -> Foo<'a> {
5-
| --- help: consider changing the type of `other` to : `Foo<'a>`
5+
| --- help: add explicit lifetime `'a` to the type of `other`: `Foo<'a>`
66
...
77
LL | other //~ ERROR explicit lifetime
88
| ^^^^^ lifetime `'a` required

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
88
--> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:8
99
|
1010
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
11-
| ---- help: consider changing the type of `x` to : `&'a i32`
11+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
1212
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
1313
| ^^^^^ lifetime `'a` required
1414

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
22
--> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
33
|
44
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
5-
| ---- help: consider changing the type of `x` to : `&'a i32`
5+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
66
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
77
| ^ lifetime `'a` required
88

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in parameter type
88
--> $DIR/ex1-return-one-existing-name-if-else-3.rs:11:16
99
|
1010
LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
11-
| ^ --------------- help: consider changing type to : `(&'a i32, &'a i32)`
11+
| ^ --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
1212
| |
1313
| lifetime `'a` required
1414

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in parameter type
22
--> $DIR/ex1-return-one-existing-name-if-else-3.rs:12:27
33
|
44
LL | fn foo<'a>((x, y): (&'a i32, &i32)) -> &'a i32 {
5-
| --------------- help: consider changing type to : `(&'a i32, &'a i32)`
5+
| --------------- help: add explicit lifetime `'a` to type: `(&'a i32, &'a i32)`
66
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
77
| ^ lifetime `'a` required
88

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
88
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:7
99
|
1010
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
11-
| ---- help: consider changing the type of `x` to : `&'a i32`
11+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
1212
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
1313
| ^^^^^ lifetime `'a` required
1414

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
22
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:15
33
|
44
LL | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
5-
| ---- help: consider changing the type of `x` to : `&'a i32`
5+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
66
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
77
| ^ lifetime `'a` required
88

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
88
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:5
99
|
1010
LL | fn foo<'a>(&'a self, x: &i32) -> &i32 {
11-
| ---- help: consider changing the type of `x` to : `&'a i32`
11+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
1212
LL |
1313
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'a` required

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
22
--> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
33
|
44
LL | fn foo<'a>(&'a self, x: &i32) -> &i32 {
5-
| ---- help: consider changing the type of `x` to : `&'a i32`
5+
| ---- help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
66
LL |
77
LL | if true { &self.field } else { x } //~ ERROR explicit lifetime
88
| ^ lifetime `'a` required

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
88
--> $DIR/ex1-return-one-existing-name-if-else.rs:12:8
99
|
1010
LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
11-
| ---- help: consider changing the type of `y` to : `&'a i32`
11+
| ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
1212
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
1313
| ^^^^^ lifetime `'a` required
1414

src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
22
--> $DIR/ex1-return-one-existing-name-if-else.rs:12:27
33
|
44
LL | fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
5-
| ---- help: consider changing the type of `y` to : `&'a i32`
5+
| ---- help: add explicit lifetime `'a` to the type of `y`: `&'a i32`
66
LL | if x > y { x } else { y } //~ ERROR explicit lifetime
77
| ^ lifetime `'a` required
88

src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
88
--> $DIR/ex2a-push-one-existing-name-2.rs:16:5
99
|
1010
LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
11-
| -------- help: consider changing the type of `x` to : `Ref<'a, i32>`
11+
| -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
1212
LL | y.push(x); //~ ERROR explicit lifetime
1313
| ^^^^^^^^^ lifetime `'a` required
1414

src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `x`
22
--> $DIR/ex2a-push-one-existing-name-2.rs:16:12
33
|
44
LL | fn foo<'a>(x: Ref<i32>, y: &mut Vec<Ref<'a, i32>>) {
5-
| -------- help: consider changing the type of `x` to : `Ref<'a, i32>`
5+
| -------- help: add explicit lifetime `'a` to the type of `x`: `Ref<'a, i32>`
66
LL | y.push(x); //~ ERROR explicit lifetime
77
| ^ lifetime `'a` required
88

src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
22
--> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:12
33
|
44
LL | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T)
5-
| -- help: consider changing the type of `y` to : `&'a T`
5+
| -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`
66
...
77
LL | x.push(y); //~ ERROR explicit lifetime required
88
| ^ lifetime `'a` required

src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `y`
88
--> $DIR/ex2a-push-one-existing-name.rs:16:5
99
|
1010
LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
11-
| -------- help: consider changing the type of `y` to : `Ref<'a, i32>`
11+
| -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
1212
LL | x.push(y); //~ ERROR explicit lifetime
1313
| ^^^^^^^^^ lifetime `'a` required
1414

src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0621]: explicit lifetime required in the type of `y`
22
--> $DIR/ex2a-push-one-existing-name.rs:16:12
33
|
44
LL | fn foo<'a>(x: &mut Vec<Ref<'a, i32>>, y: Ref<i32>) {
5-
| -------- help: consider changing the type of `y` to : `Ref<'a, i32>`
5+
| -------- help: add explicit lifetime `'a` to the type of `y`: `Ref<'a, i32>`
66
LL | x.push(y); //~ ERROR explicit lifetime
77
| ^ lifetime `'a` required
88

src/test/ui/nll/closure-requirements/region-lbr-anon-does-not-outlive-static.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error[E0621]: explicit lifetime required in the type of `x`
88
--> $DIR/region-lbr-anon-does-not-outlive-static.rs:19:5
99
|
1010
LL | fn foo(x: &u32) -> &'static u32 {
11-
| ---- help: consider changing the type of `x` to : `&ReStatic u32`
11+
| ---- help: add explicit lifetime `ReStatic` to the type of `x`: `&ReStatic u32`
1212
LL | &*x
1313
| ^^^ lifetime `ReStatic` required
1414

src/test/ui/nll/guarantor-issue-46974.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0621]: explicit lifetime required in the type of `s`
1313
--> $DIR/guarantor-issue-46974.rs:25:5
1414
|
1515
LL | fn bar(s: &Box<(i32,)>) -> &'static i32 {
16-
| ------------ help: consider changing the type of `s` to : `&'static std::boxed::Box<(i32,)>`
16+
| ------------ help: add explicit lifetime `'static` to the type of `s`: `&'static std::boxed::Box<(i32,)>`
1717
LL | // FIXME(#46983): error message should be better
1818
LL | &s.0 //~ ERROR explicit lifetime required in the type of `s` [E0621]
1919
| ^^^^ lifetime `'static` required

src/test/ui/nll/ty-outlives/impl-trait-captures.stderr

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ LL | x
77
error[E0621]: explicit lifetime required in the type of `x`
88
--> $DIR/impl-trait-captures.rs:21:5
99
|
10-
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
11-
| -- help: consider changing the type of `x` to : `&ReEarlyBound(0, 'a) T`
1210
LL | x
1311
| ^ lifetime `ReEarlyBound(0, 'a)` required
12+
help: add explicit lifetime `ReEarlyBound(0, 'a)` to the type of `x`
13+
|
14+
LL | fn foo<'a, T>(x: &ReEarlyBound(0, 'a) T) -> impl Foo<'a> {
15+
| ^^^^^^^^^^^^^^^^^^^^^^
1416

1517
error: aborting due to previous error
1618

0 commit comments

Comments
 (0)