-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
106 additions
and
0 deletions.
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
error[E0261]: use of undeclared lifetime name `'a` | ||
--> $DIR/missing-lifetimes-in-signature.rs:38:11 | ||
| | ||
LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ||
| - ^^ undeclared lifetime | ||
| | | ||
| help: consider introducing lifetime `'a` here: `'a,` | ||
|
||
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds | ||
--> $DIR/missing-lifetimes-in-signature.rs:19:5 | ||
| | ||
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() | ||
| ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 22:6]` captures the anonymous lifetime defined here | ||
... | ||
LL | / move || { | ||
LL | | | ||
LL | | *dest = g.get(); | ||
LL | | } | ||
| |_____^ | ||
| | ||
help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound | ||
| | ||
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ||
| ++++ | ||
|
||
error[E0311]: the parameter type `G` may not live long enough | ||
--> $DIR/missing-lifetimes-in-signature.rs:32:5 | ||
| | ||
LL | / move || { | ||
LL | | *dest = g.get(); | ||
LL | | } | ||
| |_____^ | ||
| | ||
note: the parameter type `G` must be valid for the anonymous lifetime defined here... | ||
--> $DIR/missing-lifetimes-in-signature.rs:26:26 | ||
| | ||
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ||
| ^^^^^^ | ||
|
||
error[E0311]: the parameter type `G` may not live long enough | ||
--> $DIR/missing-lifetimes-in-signature.rs:55:5 | ||
| | ||
LL | / move || { | ||
LL | | *dest = g.get(); | ||
LL | | } | ||
| |_____^ | ||
| | ||
note: the parameter type `G` must be valid for the anonymous lifetime defined here... | ||
--> $DIR/missing-lifetimes-in-signature.rs:49:34 | ||
| | ||
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ | ||
| ^^^^^^ | ||
|
||
error[E0311]: the parameter type `G` may not live long enough | ||
--> $DIR/missing-lifetimes-in-signature.rs:65:9 | ||
| | ||
LL | / move || { | ||
LL | | *dest = g.get(); | ||
LL | | } | ||
| |_________^ | ||
| | ||
note: the parameter type `G` must be valid for the anonymous lifetime defined here... | ||
--> $DIR/missing-lifetimes-in-signature.rs:62:47 | ||
| | ||
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { | ||
| ^^^^^^ | ||
|
||
error[E0311]: the parameter type `G` may not live long enough | ||
--> $DIR/missing-lifetimes-in-signature.rs:77:5 | ||
| | ||
LL | / move || { | ||
LL | | *dest = g.get(); | ||
LL | | } | ||
| |_____^ | ||
| | ||
note: the parameter type `G` must be valid for the anonymous lifetime defined here... | ||
--> $DIR/missing-lifetimes-in-signature.rs:72:34 | ||
| | ||
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a | ||
| ^^^^^^ | ||
|
||
error[E0621]: explicit lifetime required in the type of `dest` | ||
--> $DIR/missing-lifetimes-in-signature.rs:77:5 | ||
| | ||
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a | ||
| ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T` | ||
... | ||
LL | / move || { | ||
LL | | *dest = g.get(); | ||
LL | | } | ||
| |_____^ lifetime `'a` required | ||
|
||
error[E0309]: the parameter type `G` may not live long enough | ||
--> $DIR/missing-lifetimes-in-signature.rs:89:5 | ||
| | ||
LL | / move || { | ||
LL | | *dest = g.get(); | ||
LL | | } | ||
| |_____^ | ||
| | ||
= help: consider adding an explicit lifetime bound `G: 'a`... | ||
|
||
error: aborting due to 8 previous errors | ||
|
||
Some errors have detailed explanations: E0261, E0309, E0621, E0700. | ||
For more information about an error, try `rustc --explain E0261`. |