Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 20, 2020
1 parent 78d3ea5 commit 2102723
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions src/librustc_resolve/lifetimes.rs
Expand Up @@ -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,
);
Expand All @@ -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,
);
Expand All @@ -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,
);
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/error-codes/E0106.stderr
Expand Up @@ -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,
Expand All @@ -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),
Expand All @@ -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;
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand All @@ -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>,
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/impl-header-lifetime-elision/assoc-type.stderr
Expand Up @@ -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;
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand All @@ -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;
| ^^^^^^^^^^^ ^^^^^^^^^
Expand Down
Expand Up @@ -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>);
| ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-19707.stderr
Expand Up @@ -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;
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand All @@ -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) {}
| ^^^^^^^^^^ ^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-26638.stderr
Expand Up @@ -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() }
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/issues/issue-30255.stderr
Expand Up @@ -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 {
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand All @@ -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 {
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand All @@ -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 {
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand Down
Expand Up @@ -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 {
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand All @@ -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 {
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand Down
Expand Up @@ -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 {
| ^^^^^^^^^^^ ^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/proc-macro/item-error.stderr
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-in-enums-anon.stderr
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-in-structs-anon.stderr
Expand Up @@ -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
Expand Down
Expand Up @@ -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>,
Expand Down
Expand Up @@ -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>,
Expand Down
Expand Up @@ -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 { } }
| ^^^^^^^^^^^ ^^^^^^^^^
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/underscore-lifetime/in-struct.stderr
Expand Up @@ -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,
Expand All @@ -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),
Expand Down
Expand Up @@ -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 }
| ^^^^^^^^^^^ ^^^^^^^^^
Expand Down

0 comments on commit 2102723

Please sign in to comment.