review comments
This commit is contained in:
parent
78d3ea5484
commit
2102723887
@ -2952,7 +2952,7 @@ fn add_missing_lifetime_specifiers_label(
|
||||
if !introduce_suggestion.is_empty() {
|
||||
introduce_suggestion.push((span, "&'lifetime ".to_string()));
|
||||
err.multipart_suggestion(
|
||||
"consider introducing a named lifetime",
|
||||
"consider introducing a named lifetime parameter",
|
||||
introduce_suggestion,
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
@ -2963,7 +2963,7 @@ fn add_missing_lifetime_specifiers_label(
|
||||
if !introduce_suggestion.is_empty() {
|
||||
introduce_suggestion.push((span, "'lifetime".to_string()));
|
||||
err.multipart_suggestion(
|
||||
"consider introducing a named lifetime",
|
||||
"consider introducing a named lifetime parameter",
|
||||
introduce_suggestion,
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
@ -2974,7 +2974,7 @@ fn add_missing_lifetime_specifiers_label(
|
||||
if !introduce_suggestion.is_empty() {
|
||||
introduce_suggestion.push((span, format!("{}<'lifetime>", snippet)));
|
||||
err.multipart_suggestion(
|
||||
"consider introducing a named lifetime",
|
||||
"consider introducing a named lifetime parameter",
|
||||
introduce_suggestion,
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | x: &bool,
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | struct Foo<'lifetime> {
|
||||
LL | x: &'lifetime bool,
|
||||
@ -16,7 +16,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | B(&bool),
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | enum Bar<'lifetime> {
|
||||
LL | A(u8),
|
||||
@ -29,7 +29,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | type MyStr = &str;
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | type MyStr<'lifetime> = &'lifetime str;
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
@ -40,7 +40,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | baz: Baz,
|
||||
| ^^^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | struct Quux<'lifetime> {
|
||||
LL | baz: Baz<'lifetime>,
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | type Output = &i32;
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | type Output<'lifetime> = &'lifetime i32;
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
@ -15,7 +15,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | type Output = &'_ i32;
|
||||
| ^^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | type Output<'lifetime> = &'lifetime i32;
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | struct Heartbreak(Betrayal);
|
||||
| ^^^^^^^^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | struct Heartbreak<'lifetime>(Betrayal<'lifetime>);
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -5,7 +5,7 @@ LL | type Foo = fn(&u8, &u8) -> &u8;
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | type Foo<'lifetime> = fn(&u8, &u8) -> &'lifetime u8;
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
@ -17,7 +17,7 @@ LL | fn bar<F: Fn(&u8, &u8) -> &u8>(f: &F) {}
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn bar<'lifetime, F: Fn(&u8, &u8) -> &'lifetime u8>(f: &F) {}
|
||||
| ^^^^^^^^^^ ^^^^^^^^^^
|
||||
|
@ -5,7 +5,7 @@ LL | fn parse_type(iter: Box<dyn Iterator<Item=&str>+'static>) -> &str { iter.ne
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn parse_type<'lifetime>(iter: Box<dyn Iterator<Item=&str>+'static>) -> &'lifetime str { iter.next() }
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
|
@ -5,7 +5,7 @@ LL | fn f(a: &S, b: i32) -> &i32 {
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn f<'lifetime>(a: &S, b: i32) -> &'lifetime i32 {
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
@ -17,7 +17,7 @@ LL | fn g(a: &S, b: bool, c: &i32) -> &i32 {
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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`
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn g<'lifetime>(a: &S, b: bool, c: &i32) -> &'lifetime i32 {
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
@ -29,7 +29,7 @@ LL | fn h(a: &bool, b: bool, c: &S, d: &i32) -> &i32 {
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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`
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn h<'lifetime>(a: &bool, b: bool, c: &S, d: &i32) -> &'lifetime i32 {
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
|
@ -13,7 +13,7 @@ LL | fn g(_x: &isize, _y: &isize) -> &isize {
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_x` or `_y`
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn g<'lifetime>(_x: &isize, _y: &isize) -> &'lifetime isize {
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
@ -25,7 +25,7 @@ LL | fn h(_x: &Foo) -> &isize {
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn h<'lifetime>(_x: &Foo) -> &'lifetime isize {
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
|
@ -5,7 +5,7 @@ LL | fn foo(x: &i32, y: &i32) -> &i32 {
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn foo<'lifetime>(x: &i32, y: &i32) -> &'lifetime i32 {
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^^
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | a: &u64
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | struct A<'lifetime> {
|
||||
LL | a: &'lifetime u64
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | Bar(&isize)
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | enum Foo<'lifetime> {
|
||||
LL | Bar(&'lifetime isize)
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | x: &isize
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | struct Foo<'lifetime> {
|
||||
LL | x: &'lifetime isize
|
||||
|
@ -5,7 +5,7 @@ LL | let _: dyn Foo(&isize, &usize) -> &usize;
|
||||
| ^ expected named lifetime parameter
|
||||
|
|
||||
= 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
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn main<'lifetime>() {
|
||||
LL | eq::< dyn for<'a> Foo<(&'a isize,), Output=&'a isize>,
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | x: Box<dyn Debug + '_>,
|
||||
| ^^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | struct Foo<'lifetime> {
|
||||
LL | x: Box<dyn Debug + 'lifetime>,
|
||||
|
@ -5,7 +5,7 @@ LL | fn foo(x: &u32, y: &u32) -> &'_ u32 { loop { } }
|
||||
| ^^ expected named lifetime parameter
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn foo<'lifetime>(x: &u32, y: &u32) -> &'lifetime u32 { loop { } }
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^
|
||||
|
@ -4,7 +4,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | x: &'_ u32,
|
||||
| ^^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | struct Foo<'lifetime> {
|
||||
LL | x: &'lifetime u32,
|
||||
@ -16,7 +16,7 @@ error[E0106]: missing lifetime specifier
|
||||
LL | Variant(&'_ u32),
|
||||
| ^^ expected named lifetime parameter
|
||||
|
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | enum Bar<'lifetime> {
|
||||
LL | Variant(&'lifetime u32),
|
||||
|
@ -31,7 +31,7 @@ LL | fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y }
|
||||
| ^^ expected named lifetime parameter
|
||||
|
|
||||
= 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`
|
||||
help: consider introducing a named lifetime
|
||||
help: consider introducing a named lifetime parameter
|
||||
|
|
||||
LL | fn foo2<'lifetime>(_: &'_ u8, y: &'_ u8) -> &'lifetime u8 { y }
|
||||
| ^^^^^^^^^^^ ^^^^^^^^^
|
||||
|
Loading…
x
Reference in New Issue
Block a user