]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-85113.stderr
Loop over all opaque types instead of looking at just the first one with the same...
[rust.git] / src / test / ui / type-alias-impl-trait / issue-85113.stderr
1 error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2   --> $DIR/issue-85113.rs:5:29
3    |
4 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
5    |                             ^^^^^^^^^^^^^^^^^^^^
6    |
7 note: hidden type `&'<empty> str` captures lifetime smaller than the function body
8   --> $DIR/issue-85113.rs:5:29
9    |
10 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
11    |                             ^^^^^^^^^^^^^^^^^^^^
12
13 error: concrete type differs from previous defining opaque type use
14   --> $DIR/issue-85113.rs:14:1
15    |
16 LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
17    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'<empty> str`, got `&'a str`
18    |
19 note: previous use here
20   --> $DIR/issue-85113.rs:14:1
21    |
22 LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
23    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
25 error[E0477]: the type `&'<empty> str` does not fulfill the required lifetime
26   --> $DIR/issue-85113.rs:5:29
27    |
28 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
29    |                             ^^^^^^^^^^^^^^^^^^^^
30    |
31 note: type must outlive the lifetime `'a` as defined on the item at 5:23
32   --> $DIR/issue-85113.rs:5:23
33    |
34 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
35    |                       ^^
36
37 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
38   --> $DIR/issue-85113.rs:5:29
39    |
40 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
41    |                             ^^^^^^^^^^^^^^^^^^^^
42    |
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
46    |
47 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
48    |                       ^^
49 note: ...so that the types are compatible
50   --> $DIR/issue-85113.rs:5:29
51    |
52 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
53    |                             ^^^^^^^^^^^^^^^^^^^^
54    = note: expected `Output<'a>`
55               found `Output<'_>`
56
57 error: aborting due to 4 previous errors
58
59 Some errors have detailed explanations: E0477, E0495, E0700.
60 For more information about an error, try `rustc --explain E0477`.