Skip to content

Commit 2102723

Browse files
committed
review comments
1 parent 78d3ea5 commit 2102723

17 files changed

+28
-28
lines changed

src/librustc_resolve/lifetimes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,7 +2952,7 @@ fn add_missing_lifetime_specifiers_label(
29522952
if !introduce_suggestion.is_empty() {
29532953
introduce_suggestion.push((span, "&'lifetime ".to_string()));
29542954
err.multipart_suggestion(
2955-
"consider introducing a named lifetime",
2955+
"consider introducing a named lifetime parameter",
29562956
introduce_suggestion,
29572957
Applicability::MaybeIncorrect,
29582958
);
@@ -2963,7 +2963,7 @@ fn add_missing_lifetime_specifiers_label(
29632963
if !introduce_suggestion.is_empty() {
29642964
introduce_suggestion.push((span, "'lifetime".to_string()));
29652965
err.multipart_suggestion(
2966-
"consider introducing a named lifetime",
2966+
"consider introducing a named lifetime parameter",
29672967
introduce_suggestion,
29682968
Applicability::MaybeIncorrect,
29692969
);
@@ -2974,7 +2974,7 @@ fn add_missing_lifetime_specifiers_label(
29742974
if !introduce_suggestion.is_empty() {
29752975
introduce_suggestion.push((span, format!("{}<'lifetime>", snippet)));
29762976
err.multipart_suggestion(
2977-
"consider introducing a named lifetime",
2977+
"consider introducing a named lifetime parameter",
29782978
introduce_suggestion,
29792979
Applicability::MaybeIncorrect,
29802980
);

src/test/ui/error-codes/E0106.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | x: &bool,
55
| ^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | struct Foo<'lifetime> {
1010
LL | x: &'lifetime bool,
@@ -16,7 +16,7 @@ error[E0106]: missing lifetime specifier
1616
LL | B(&bool),
1717
| ^ expected named lifetime parameter
1818
|
19-
help: consider introducing a named lifetime
19+
help: consider introducing a named lifetime parameter
2020
|
2121
LL | enum Bar<'lifetime> {
2222
LL | A(u8),
@@ -29,7 +29,7 @@ error[E0106]: missing lifetime specifier
2929
LL | type MyStr = &str;
3030
| ^ expected named lifetime parameter
3131
|
32-
help: consider introducing a named lifetime
32+
help: consider introducing a named lifetime parameter
3333
|
3434
LL | type MyStr<'lifetime> = &'lifetime str;
3535
| ^^^^^^^^^^^ ^^^^^^^^^^
@@ -40,7 +40,7 @@ error[E0106]: missing lifetime specifier
4040
LL | baz: Baz,
4141
| ^^^ expected named lifetime parameter
4242
|
43-
help: consider introducing a named lifetime
43+
help: consider introducing a named lifetime parameter
4444
|
4545
LL | struct Quux<'lifetime> {
4646
LL | baz: Baz<'lifetime>,

src/test/ui/impl-header-lifetime-elision/assoc-type.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | type Output = &i32;
55
| ^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | type Output<'lifetime> = &'lifetime i32;
1010
| ^^^^^^^^^^^ ^^^^^^^^^^
@@ -15,7 +15,7 @@ error[E0106]: missing lifetime specifier
1515
LL | type Output = &'_ i32;
1616
| ^^ expected named lifetime parameter
1717
|
18-
help: consider introducing a named lifetime
18+
help: consider introducing a named lifetime parameter
1919
|
2020
LL | type Output<'lifetime> = &'lifetime i32;
2121
| ^^^^^^^^^^^ ^^^^^^^^^

src/test/ui/in-band-lifetimes/issue-61124-anon-lifetime-in-struct-declaration.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | struct Heartbreak(Betrayal);
55
| ^^^^^^^^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | struct Heartbreak<'lifetime>(Betrayal<'lifetime>);
1010
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^

src/test/ui/issues/issue-19707.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type Foo = fn(&u8, &u8) -> &u8;
55
| ^ expected named lifetime parameter
66
|
77
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
8-
help: consider introducing a named lifetime
8+
help: consider introducing a named lifetime parameter
99
|
1010
LL | type Foo<'lifetime> = fn(&u8, &u8) -> &'lifetime u8;
1111
| ^^^^^^^^^^^ ^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | fn bar<F: Fn(&u8, &u8) -> &u8>(f: &F) {}
1717
| ^ expected named lifetime parameter
1818
|
1919
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
20-
help: consider introducing a named lifetime
20+
help: consider introducing a named lifetime parameter
2121
|
2222
LL | fn bar<'lifetime, F: Fn(&u8, &u8) -> &'lifetime u8>(f: &F) {}
2323
| ^^^^^^^^^^ ^^^^^^^^^^

src/test/ui/issues/issue-26638.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.ne
55
| ^ expected named lifetime parameter
66
|
77
= help: this function's return type contains a borrowed value, but the signature does not say which one of `iter`'s 2 lifetimes it is borrowed from
8-
help: consider introducing a named lifetime
8+
help: consider introducing a named lifetime parameter
99
|
1010
LL | fn parse_type<'lifetime>(iter: Box<dyn Iterator<Item=&str>+'static>) -> &'lifetime str { iter.next() }
1111
| ^^^^^^^^^^^ ^^^^^^^^^^

src/test/ui/issues/issue-30255.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn f(a: &S, b: i32) -> &i32 {
55
| ^ expected named lifetime parameter
66
|
77
= help: this function's return type contains a borrowed value, but the signature does not say which one of `a`'s 2 lifetimes it is borrowed from
8-
help: consider introducing a named lifetime
8+
help: consider introducing a named lifetime parameter
99
|
1010
LL | fn f<'lifetime>(a: &S, b: i32) -> &'lifetime i32 {
1111
| ^^^^^^^^^^^ ^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | fn g(a: &S, b: bool, c: &i32) -> &i32 {
1717
| ^ expected named lifetime parameter
1818
|
1919
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from one of `a`'s 2 lifetimes or `c`
20-
help: consider introducing a named lifetime
20+
help: consider introducing a named lifetime parameter
2121
|
2222
LL | fn g<'lifetime>(a: &S, b: bool, c: &i32) -> &'lifetime i32 {
2323
| ^^^^^^^^^^^ ^^^^^^^^^^
@@ -29,7 +29,7 @@ LL | fn h(a: &bool, b: bool, c: &S, d: &i32) -> &i32 {
2929
| ^ expected named lifetime parameter
3030
|
3131
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a`, one of `c`'s 2 lifetimes, or `d`
32-
help: consider introducing a named lifetime
32+
help: consider introducing a named lifetime parameter
3333
|
3434
LL | fn h<'lifetime>(a: &bool, b: bool, c: &S, d: &i32) -> &'lifetime i32 {
3535
| ^^^^^^^^^^^ ^^^^^^^^^^

src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | fn g(_x: &isize, _y: &isize) -> &isize {
1313
| ^ expected named lifetime parameter
1414
|
1515
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_x` or `_y`
16-
help: consider introducing a named lifetime
16+
help: consider introducing a named lifetime parameter
1717
|
1818
LL | fn g<'lifetime>(_x: &isize, _y: &isize) -> &'lifetime isize {
1919
| ^^^^^^^^^^^ ^^^^^^^^^^
@@ -25,7 +25,7 @@ LL | fn h(_x: &Foo) -> &isize {
2525
| ^ expected named lifetime parameter
2626
|
2727
= help: this function's return type contains a borrowed value, but the signature does not say which one of `_x`'s 2 lifetimes it is borrowed from
28-
help: consider introducing a named lifetime
28+
help: consider introducing a named lifetime parameter
2929
|
3030
LL | fn h<'lifetime>(_x: &Foo) -> &'lifetime isize {
3131
| ^^^^^^^^^^^ ^^^^^^^^^^

src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn foo(x: &i32, y: &i32) -> &i32 {
55
| ^ expected named lifetime parameter
66
|
77
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
8-
help: consider introducing a named lifetime
8+
help: consider introducing a named lifetime parameter
99
|
1010
LL | fn foo<'lifetime>(x: &i32, y: &i32) -> &'lifetime i32 {
1111
| ^^^^^^^^^^^ ^^^^^^^^^^

src/test/ui/proc-macro/item-error.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | a: &u64
55
| ^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | struct A<'lifetime> {
1010
LL | a: &'lifetime u64

src/test/ui/regions/regions-in-enums-anon.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | Bar(&isize)
55
| ^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | enum Foo<'lifetime> {
1010
LL | Bar(&'lifetime isize)

src/test/ui/regions/regions-in-structs-anon.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | x: &isize
55
| ^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | struct Foo<'lifetime> {
1010
LL | x: &'lifetime isize

src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | let _: dyn Foo(&isize, &usize) -> &usize;
55
| ^ expected named lifetime parameter
66
|
77
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
8-
help: consider introducing a named lifetime
8+
help: consider introducing a named lifetime parameter
99
|
1010
LL | fn main<'lifetime>() {
1111
LL | eq::< dyn for<'a> Foo<(&'a isize,), Output=&'a isize>,

src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | x: Box<dyn Debug + '_>,
55
| ^^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | struct Foo<'lifetime> {
1010
LL | x: Box<dyn Debug + 'lifetime>,

src/test/ui/underscore-lifetime/in-fn-return-illegal.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } }
55
| ^^ expected named lifetime parameter
66
|
77
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
8-
help: consider introducing a named lifetime
8+
help: consider introducing a named lifetime parameter
99
|
1010
LL | fn foo<'lifetime>(x: &u32, y: &u32) -> &'lifetime u32 { loop { } }
1111
| ^^^^^^^^^^^ ^^^^^^^^^

src/test/ui/underscore-lifetime/in-struct.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
44
LL | x: &'_ u32,
55
| ^^ expected named lifetime parameter
66
|
7-
help: consider introducing a named lifetime
7+
help: consider introducing a named lifetime parameter
88
|
99
LL | struct Foo<'lifetime> {
1010
LL | x: &'lifetime u32,
@@ -16,7 +16,7 @@ error[E0106]: missing lifetime specifier
1616
LL | Variant(&'_ u32),
1717
| ^^ expected named lifetime parameter
1818
|
19-
help: consider introducing a named lifetime
19+
help: consider introducing a named lifetime parameter
2020
|
2121
LL | enum Bar<'lifetime> {
2222
LL | Variant(&'lifetime u32),

src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LL | fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y }
3131
| ^^ expected named lifetime parameter
3232
|
3333
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or `y`
34-
help: consider introducing a named lifetime
34+
help: consider introducing a named lifetime parameter
3535
|
3636
LL | fn foo2<'lifetime>(_: &'_ u8, y: &'_ u8) -> &'lifetime u8 { y }
3737
| ^^^^^^^^^^^ ^^^^^^^^^

0 commit comments

Comments
 (0)