|
| 1 | +error[E0261]: use of undeclared lifetime name `'a` |
| 2 | + --> $DIR/missing-lifetimes-in-signature.rs:38:11 |
| 3 | + | |
| 4 | +LL | fn baz<G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ |
| 5 | + | - ^^ undeclared lifetime |
| 6 | + | | |
| 7 | + | help: consider introducing lifetime `'a` here: `'a,` |
| 8 | + |
| 9 | +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds |
| 10 | + --> $DIR/missing-lifetimes-in-signature.rs:19:5 |
| 11 | + | |
| 12 | +LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() |
| 13 | + | ------ hidden type `[closure@$DIR/missing-lifetimes-in-signature.rs:19:5: 22:6]` captures the anonymous lifetime defined here |
| 14 | +... |
| 15 | +LL | / move || { |
| 16 | +LL | | |
| 17 | +LL | | *dest = g.get(); |
| 18 | +LL | | } |
| 19 | + | |_____^ |
| 20 | + | |
| 21 | +help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound |
| 22 | + | |
| 23 | +LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ |
| 24 | + | ++++ |
| 25 | + |
| 26 | +error[E0311]: the parameter type `G` may not live long enough |
| 27 | + --> $DIR/missing-lifetimes-in-signature.rs:32:5 |
| 28 | + | |
| 29 | +LL | / move || { |
| 30 | +LL | | *dest = g.get(); |
| 31 | +LL | | } |
| 32 | + | |_____^ |
| 33 | + | |
| 34 | +note: the parameter type `G` must be valid for the anonymous lifetime defined here... |
| 35 | + --> $DIR/missing-lifetimes-in-signature.rs:26:26 |
| 36 | + | |
| 37 | +LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ |
| 38 | + | ^^^^^^ |
| 39 | + |
| 40 | +error[E0311]: the parameter type `G` may not live long enough |
| 41 | + --> $DIR/missing-lifetimes-in-signature.rs:55:5 |
| 42 | + | |
| 43 | +LL | / move || { |
| 44 | +LL | | *dest = g.get(); |
| 45 | +LL | | } |
| 46 | + | |_____^ |
| 47 | + | |
| 48 | +note: the parameter type `G` must be valid for the anonymous lifetime defined here... |
| 49 | + --> $DIR/missing-lifetimes-in-signature.rs:49:34 |
| 50 | + | |
| 51 | +LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ |
| 52 | + | ^^^^^^ |
| 53 | + |
| 54 | +error[E0311]: the parameter type `G` may not live long enough |
| 55 | + --> $DIR/missing-lifetimes-in-signature.rs:65:9 |
| 56 | + | |
| 57 | +LL | / move || { |
| 58 | +LL | | *dest = g.get(); |
| 59 | +LL | | } |
| 60 | + | |_________^ |
| 61 | + | |
| 62 | +note: the parameter type `G` must be valid for the anonymous lifetime defined here... |
| 63 | + --> $DIR/missing-lifetimes-in-signature.rs:62:47 |
| 64 | + | |
| 65 | +LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ { |
| 66 | + | ^^^^^^ |
| 67 | + |
| 68 | +error[E0311]: the parameter type `G` may not live long enough |
| 69 | + --> $DIR/missing-lifetimes-in-signature.rs:77:5 |
| 70 | + | |
| 71 | +LL | / move || { |
| 72 | +LL | | *dest = g.get(); |
| 73 | +LL | | } |
| 74 | + | |_____^ |
| 75 | + | |
| 76 | +note: the parameter type `G` must be valid for the anonymous lifetime defined here... |
| 77 | + --> $DIR/missing-lifetimes-in-signature.rs:72:34 |
| 78 | + | |
| 79 | +LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a |
| 80 | + | ^^^^^^ |
| 81 | + |
| 82 | +error[E0621]: explicit lifetime required in the type of `dest` |
| 83 | + --> $DIR/missing-lifetimes-in-signature.rs:77:5 |
| 84 | + | |
| 85 | +LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a |
| 86 | + | ------ help: add explicit lifetime `'a` to the type of `dest`: `&'a mut T` |
| 87 | +... |
| 88 | +LL | / move || { |
| 89 | +LL | | *dest = g.get(); |
| 90 | +LL | | } |
| 91 | + | |_____^ lifetime `'a` required |
| 92 | + |
| 93 | +error[E0309]: the parameter type `G` may not live long enough |
| 94 | + --> $DIR/missing-lifetimes-in-signature.rs:89:5 |
| 95 | + | |
| 96 | +LL | / move || { |
| 97 | +LL | | *dest = g.get(); |
| 98 | +LL | | } |
| 99 | + | |_____^ |
| 100 | + | |
| 101 | + = help: consider adding an explicit lifetime bound `G: 'a`... |
| 102 | + |
| 103 | +error: aborting due to 8 previous errors |
| 104 | + |
| 105 | +Some errors have detailed explanations: E0261, E0309, E0621, E0700. |
| 106 | +For more information about an error, try `rustc --explain E0261`. |
0 commit comments