]>
Commit | Line | Data |
---|---|---|
064997fb | 1 | error[E0700]: hidden type for `impl Trait<'d, 'e>` captures lifetime that does not appear in bounds |
5e7ed085 | 2 | --> $DIR/ordinary-bounds-unrelated.rs:28:33 |
dc9dc135 XL |
3 | | |
4 | LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e> | |
9ffffee4 FG |
5 | | -- ------------------ opaque type defined here |
6 | | | | |
7 | | hidden type `Ordinary<'b>` captures the lifetime `'b` as defined here | |
5e7ed085 FG |
8 | ... |
9 | LL | if condition() { a } else { b } | |
10 | | ^ | |
dc9dc135 | 11 | | |
2b03887a | 12 | help: to declare that `impl Trait<'d, 'e>` captures `'b`, you can add an explicit `'b` lifetime bound |
dc9dc135 | 13 | | |
3c0e092e XL |
14 | LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e> + 'b |
15 | | ++++ | |
dc9dc135 | 16 | |
4b012472 | 17 | error: aborting due to 1 previous error |
dc9dc135 XL |
18 | |
19 | For more information about this error, try `rustc --explain E0700`. |