|
| 1 | +error[E0700]: hidden type for `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures lifetime that does not appear in bounds |
| 2 | + --> $DIR/nested-impl-trait-fail.rs:17:5 |
| 3 | + | |
| 4 | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> |
| 5 | + | -- hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here |
| 6 | +... |
| 7 | +LL | [a] |
| 8 | + | ^^^ |
| 9 | + | |
| 10 | +help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 11 | + | |
| 12 | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's |
| 13 | + | ++++ |
| 14 | +help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 15 | + | |
| 16 | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> |
| 17 | + | ++++ |
| 18 | + |
| 19 | +error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds |
| 20 | + --> $DIR/nested-impl-trait-fail.rs:17:5 |
| 21 | + | |
| 22 | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> |
| 23 | + | -- hidden type `&'s u8` captures the lifetime `'s` as defined here |
| 24 | +... |
| 25 | +LL | [a] |
| 26 | + | ^^^ |
| 27 | + | |
| 28 | +help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 29 | + | |
| 30 | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's |
| 31 | + | ++++ |
| 32 | +help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 33 | + | |
| 34 | +LL | fn fail_early_bound<'s, 'a, 'b>(a: &'s u8) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> |
| 35 | + | ++++ |
| 36 | + |
| 37 | +error[E0700]: hidden type for `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures lifetime that does not appear in bounds |
| 38 | + --> $DIR/nested-impl-trait-fail.rs:28:5 |
| 39 | + | |
| 40 | +LL | fn fail_late_bound<'s, 'a, 'b>( |
| 41 | + | -- hidden type `[&'s u8; 1]` captures the lifetime `'s` as defined here |
| 42 | +... |
| 43 | +LL | [a] |
| 44 | + | ^^^ |
| 45 | + | |
| 46 | +help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 47 | + | |
| 48 | +LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's { |
| 49 | + | ++++ |
| 50 | +help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 51 | + | |
| 52 | +LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> { |
| 53 | + | ++++ |
| 54 | + |
| 55 | +error[E0700]: hidden type for `impl Cap<'a> + Cap<'b>` captures lifetime that does not appear in bounds |
| 56 | + --> $DIR/nested-impl-trait-fail.rs:28:5 |
| 57 | + | |
| 58 | +LL | fn fail_late_bound<'s, 'a, 'b>( |
| 59 | + | -- hidden type `&'s u8` captures the lifetime `'s` as defined here |
| 60 | +... |
| 61 | +LL | [a] |
| 62 | + | ^^^ |
| 63 | + | |
| 64 | +help: to declare that `impl IntoIterator<Item = impl Cap<'a> + Cap<'b>>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 65 | + | |
| 66 | +LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b>> + 's { |
| 67 | + | ++++ |
| 68 | +help: to declare that `impl Cap<'a> + Cap<'b>` captures `'s`, you can add an explicit `'s` lifetime bound |
| 69 | + | |
| 70 | +LL | ) -> impl IntoIterator<Item = impl Cap<'a> + Cap<'b> + 's> { |
| 71 | + | ++++ |
| 72 | + |
| 73 | +error: aborting due to 4 previous errors |
| 74 | + |
| 75 | +For more information about this error, try `rustc --explain E0700`. |
0 commit comments