|
| 1 | +error[E0792]: expected generic lifetime parameter, found `'a` |
| 2 | + --> $DIR/higher-ranked-regions-basic.rs:17:55 |
| 3 | + | |
| 4 | +LL | type Opq<'a> = impl Sized + 'a; |
| 5 | + | -- this generic parameter must be used with a generic lifetime parameter |
| 6 | +LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq<'a>> {} |
| 7 | + | ^^ |
| 8 | + |
| 9 | +error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds |
| 10 | + --> $DIR/higher-ranked-regions-basic.rs:23:58 |
| 11 | + | |
| 12 | +LL | fn test() -> impl for<'a> Trait<'a, Ty = impl Sized> {} |
| 13 | + | -- ---------- ^^ |
| 14 | + | | | |
| 15 | + | | opaque type defined here |
| 16 | + | hidden type `&'a ()` captures the lifetime `'a` as defined here |
| 17 | + |
| 18 | +error[E0700]: hidden type for `capture_tait::Opq0` captures lifetime that does not appear in bounds |
| 19 | + --> $DIR/higher-ranked-regions-basic.rs:32:23 |
| 20 | + | |
| 21 | +LL | type Opq0 = impl Sized; |
| 22 | + | ---------- opaque type defined here |
| 23 | +LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0>; |
| 24 | + | -- hidden type `&'b ()` captures the lifetime `'b` as defined here |
| 25 | +LL | type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>; |
| 26 | +LL | fn test() -> Opq2 {} |
| 27 | + | ^^ |
| 28 | + |
| 29 | +error[E0792]: expected generic lifetime parameter, found `'a` |
| 30 | + --> $DIR/higher-ranked-regions-basic.rs:42:23 |
| 31 | + | |
| 32 | +LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'b>>; // <- Note 'b |
| 33 | + | -- this generic parameter must be used with a generic lifetime parameter |
| 34 | +... |
| 35 | +LL | fn test() -> Opq2 {} |
| 36 | + | ^^ |
| 37 | + |
| 38 | +error: concrete type differs from previous defining opaque type use |
| 39 | + --> $DIR/higher-ranked-regions-basic.rs:39:21 |
| 40 | + | |
| 41 | +LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'b>>; // <- Note 'b |
| 42 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'a ()`, got `{type error}` |
| 43 | + | |
| 44 | +note: previous use here |
| 45 | + --> $DIR/higher-ranked-regions-basic.rs:41:17 |
| 46 | + | |
| 47 | +LL | type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>; |
| 48 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 49 | + |
| 50 | +error[E0700]: hidden type for `capture_tait_complex_fail::Opq0<'a>` captures lifetime that does not appear in bounds |
| 51 | + --> $DIR/higher-ranked-regions-basic.rs:52:23 |
| 52 | + | |
| 53 | +LL | type Opq0<'a> = impl Sized; |
| 54 | + | ---------- opaque type defined here |
| 55 | +LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'a>>; // <- Note 'a |
| 56 | + | -- hidden type `&'b ()` captures the lifetime `'b` as defined here |
| 57 | +LL | type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>; |
| 58 | +LL | fn test() -> Opq2 {} |
| 59 | + | ^^ |
| 60 | + |
| 61 | +error[E0792]: non-defining opaque type use in defining scope |
| 62 | + --> $DIR/higher-ranked-regions-basic.rs:60:41 |
| 63 | + | |
| 64 | +LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'static>> {} |
| 65 | + | ^^^^^^^^^^^^^^^^^^^^^^ argument `'static` is not a generic parameter |
| 66 | + | |
| 67 | +note: for this opaque type |
| 68 | + --> $DIR/higher-ranked-regions-basic.rs:59:25 |
| 69 | + | |
| 70 | +LL | type Opq0<'a, 'b> = impl Sized; |
| 71 | + | ^^^^^^^^^^ |
| 72 | + |
| 73 | +error[E0792]: expected generic lifetime parameter, found `'a` |
| 74 | + --> $DIR/higher-ranked-regions-basic.rs:60:65 |
| 75 | + | |
| 76 | +LL | type Opq0<'a, 'b> = impl Sized; |
| 77 | + | -- this generic parameter must be used with a generic lifetime parameter |
| 78 | +LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'static>> {} |
| 79 | + | ^^ |
| 80 | + |
| 81 | +error: non-defining opaque type use in defining scope |
| 82 | + --> $DIR/higher-ranked-regions-basic.rs:69:41 |
| 83 | + | |
| 84 | +LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'a>> {} |
| 85 | + | ^^^^^^^^^^^^^^^^^ generic argument `'a` used twice |
| 86 | + | |
| 87 | +note: for this opaque type |
| 88 | + --> $DIR/higher-ranked-regions-basic.rs:68:25 |
| 89 | + | |
| 90 | +LL | type Opq0<'a, 'b> = impl Sized; |
| 91 | + | ^^^^^^^^^^ |
| 92 | + |
| 93 | +error[E0792]: expected generic lifetime parameter, found `'a` |
| 94 | + --> $DIR/higher-ranked-regions-basic.rs:69:60 |
| 95 | + | |
| 96 | +LL | type Opq0<'a, 'b> = impl Sized; |
| 97 | + | -- this generic parameter must be used with a generic lifetime parameter |
| 98 | +LL | fn test() -> impl for<'a> Trait<'a, Ty = Opq0<'a, 'a>> {} |
| 99 | + | ^^ |
| 100 | + |
| 101 | +error[E0792]: expected generic lifetime parameter, found `'a` |
| 102 | + --> $DIR/higher-ranked-regions-basic.rs:80:23 |
| 103 | + | |
| 104 | +LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'a, 'b>>; |
| 105 | + | -- this generic parameter must be used with a generic lifetime parameter |
| 106 | +... |
| 107 | +LL | fn test() -> Opq2 {} |
| 108 | + | ^^ |
| 109 | + |
| 110 | +error: concrete type differs from previous defining opaque type use |
| 111 | + --> $DIR/higher-ranked-regions-basic.rs:77:21 |
| 112 | + | |
| 113 | +LL | type Opq1<'a> = impl for<'b> Trait<'b, Ty = Opq0<'a, 'b>>; |
| 114 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'a ()`, got `{type error}` |
| 115 | + | |
| 116 | +note: previous use here |
| 117 | + --> $DIR/higher-ranked-regions-basic.rs:79:17 |
| 118 | + | |
| 119 | +LL | type Opq2 = impl for<'a> Trait<'a, Ty = Opq1<'a>>; |
| 120 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 121 | + |
| 122 | +error: aborting due to 12 previous errors |
| 123 | + |
| 124 | +Some errors have detailed explanations: E0700, E0792. |
| 125 | +For more information about an error, try `rustc --explain E0700`. |
0 commit comments