]> git.proxmox.com Git - rustc.git/blame - tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr
New upstream version 1.76.0+dfsg1
[rustc.git] / tests / ui / impl-trait / multiple-lifetimes / ordinary-bounds-unrelated.stderr
CommitLineData
064997fb 1error[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 |
4LL | 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...
9LL | if condition() { a } else { b }
10 | ^
dc9dc135 11 |
2b03887a 12help: to declare that `impl Trait<'d, 'e>` captures `'b`, you can add an explicit `'b` lifetime bound
dc9dc135 13 |
3c0e092e
XL
14LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e> + 'b
15 | ++++
dc9dc135 16
4b012472 17error: aborting due to 1 previous error
dc9dc135
XL
18
19For more information about this error, try `rustc --explain E0700`.