1 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2 --> $DIR/issue-85113.rs:5:29
4 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
7 note: hidden type `&'<empty> str` captures lifetime smaller than the function body
8 --> $DIR/issue-85113.rs:5:29
10 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
11 | ^^^^^^^^^^^^^^^^^^^^
13 error: concrete type differs from previous defining opaque type use
14 --> $DIR/issue-85113.rs:14:1
16 LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
17 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'<empty> str`, got `&'a str`
19 note: previous use here
20 --> $DIR/issue-85113.rs:14:1
22 LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
23 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 error[E0477]: the type `&'<empty> str` does not fulfill the required lifetime
26 --> $DIR/issue-85113.rs:5:29
28 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
29 | ^^^^^^^^^^^^^^^^^^^^
31 note: type must outlive the lifetime `'a` as defined on the item at 5:23
32 --> $DIR/issue-85113.rs:5:23
34 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
37 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
38 --> $DIR/issue-85113.rs:5:29
40 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
41 | ^^^^^^^^^^^^^^^^^^^^
43 = note: first, the lifetime cannot outlive the empty lifetime...
44 note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the item at 5:23...
45 --> $DIR/issue-85113.rs:5:23
47 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
49 note: ...so that the types are compatible
50 --> $DIR/issue-85113.rs:5:29
52 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
53 | ^^^^^^^^^^^^^^^^^^^^
54 = note: expected `Output<'a>`
57 error: aborting due to 4 previous errors
59 Some errors have detailed explanations: E0477, E0495, E0700.
60 For more information about an error, try `rustc --explain E0477`.