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

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)