From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../missing-lifetimes-in-signature.stderr | 166 +++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr (limited to 'src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr') diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr new file mode 100644 index 000000000..0d749f04b --- /dev/null +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr @@ -0,0 +1,166 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/missing-lifetimes-in-signature.rs:37:11 + | +LL | fn baz(g: G, dest: &mut T) -> impl FnOnce() + '_ + | - ^^ undeclared lifetime + | | + | help: consider introducing lifetime `'a` here: `'a,` + +error[E0700]: hidden type for `impl FnOnce()` captures lifetime that does not appear in bounds + --> $DIR/missing-lifetimes-in-signature.rs:19:5 + | +LL | fn foo(g: G, dest: &mut T) -> impl FnOnce() + | ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 19:12]` 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: G, dest: &mut T) -> impl FnOnce() + '_ + | ++++ + +error[E0311]: the parameter type `G` may not live long enough + --> $DIR/missing-lifetimes-in-signature.rs:30:5 + | +LL | / move || { +LL | | +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: G, dest: &mut T) -> impl FnOnce() + '_ + | ^^^^^^ +note: ...so that the type `G` will meet its required lifetime bounds + --> $DIR/missing-lifetimes-in-signature.rs:30:5 + | +LL | / move || { +LL | | +LL | | *dest = g.get(); +LL | | } + | |_____^ +help: consider adding an explicit lifetime bound... + | +LL | G: Get + 'a, + | ++++ + +error[E0311]: the parameter type `G` may not live long enough + --> $DIR/missing-lifetimes-in-signature.rs:52:5 + | +LL | / move || { +LL | | +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:48:34 + | +LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + | ^^^^^^ +note: ...so that the type `G` will meet its required lifetime bounds + --> $DIR/missing-lifetimes-in-signature.rs:52:5 + | +LL | / move || { +LL | | +LL | | *dest = g.get(); +LL | | } + | |_____^ +help: consider adding an explicit lifetime bound... + | +LL | fn qux<'a, G: 'a + '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:61:9 + | +LL | / move || { +LL | | +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:60:47 + | +LL | fn qux<'b, G: Get + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { + | ^^^^^^ +note: ...so that the type `G` will meet its required lifetime bounds + --> $DIR/missing-lifetimes-in-signature.rs:61:9 + | +LL | / move || { +LL | | +LL | | *dest = g.get(); +LL | | } + | |_________^ +help: consider adding an explicit lifetime bound... + | +LL | fn qux<'b, G: Get + 'b + 'c, 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:73:5 + | +LL | / move || { +LL | | +LL | | +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:69:34 + | +LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a + | ^^^^^^ +note: ...so that the type `G` will meet its required lifetime bounds + --> $DIR/missing-lifetimes-in-signature.rs:73:5 + | +LL | / move || { +LL | | +LL | | +LL | | *dest = g.get(); +LL | | } + | |_____^ +help: consider adding an explicit lifetime bound... + | +LL | fn bat<'a, G: 'a + 'b, 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:73: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 | | +LL | | +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:85:5 + | +LL | / move || { +LL | | +LL | | *dest = g.get(); +LL | | } + | |_____^ ...so that the type `G` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | G: Get + '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`. -- cgit v1.2.3