]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / impl-trait / multiple-lifetimes / ordinary-bounds-unsuited.stderr
1 error[E0700]: hidden type for `impl Trait<'a, 'b>` captures lifetime that does not appear in bounds
2   --> $DIR/ordinary-bounds-unsuited.rs:31:33
3    |
4 LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b>
5    |                     -- hidden type `Ordinary<'b>` captures the lifetime `'b` as defined here
6 ...
7 LL |     if condition() { a } else { b }
8    |                                 ^
9    |
10 help: to declare that `impl Trait<'a, 'b>` captures `'b`, you can add an explicit `'b` lifetime bound
11    |
12 LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b> + 'b
13    |                                                                                 ++++
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0700`.