|
| 1 | +error[E0308]: mismatched types |
| 2 | + --> $DIR/reject-opaque_types-in-fields.rs:20:13 |
| 3 | + | |
| 4 | +LL | type X = impl Iterator<Item = u64> + Unpin; |
| 5 | + | --------------------------------- the expected opaque type |
| 6 | +... |
| 7 | +LL | Foo(z.into_iter()) |
| 8 | + | ^^^^^^^^^^^^^ expected opaque type, found struct `std::vec::IntoIter` |
| 9 | + | |
| 10 | + = note: expected opaque type `impl Iterator+Unpin` |
| 11 | + found struct `std::vec::IntoIter<u64>` |
| 12 | + |
| 13 | +error[E0308]: mismatched types |
| 14 | + --> $DIR/reject-opaque_types-in-fields.rs:30:13 |
| 15 | + | |
| 16 | +LL | type X = impl Iterator<Item = u64> + Unpin; |
| 17 | + | --------------------------------- the expected opaque type |
| 18 | +... |
| 19 | +LL | Bar {a: z.into_iter() } |
| 20 | + | ^^^^^^^^^^^^^ expected opaque type, found struct `std::vec::IntoIter` |
| 21 | + | |
| 22 | + = note: expected opaque type `impl Iterator+Unpin` |
| 23 | + found struct `std::vec::IntoIter<u64>` |
| 24 | + |
| 25 | +error: could not find defining uses |
| 26 | + --> $DIR/reject-opaque_types-in-fields.rs:3:17 |
| 27 | + | |
| 28 | +LL | type ImplCopy = impl Copy; |
| 29 | + | ^^^^^^^^^ |
| 30 | + |
| 31 | +error: type alias impl traits are not allowed as field types in enums |
| 32 | + --> $DIR/reject-opaque_types-in-fields.rs:6:1 |
| 33 | + | |
| 34 | +LL | type ImplCopy = impl Copy; |
| 35 | + | -------------------------- type alias defined here |
| 36 | +... |
| 37 | +LL | / enum Wrapper { |
| 38 | +LL | | |
| 39 | +LL | | First(ImplCopy), |
| 40 | + | | -------- this field contains a type alias impl trait |
| 41 | +LL | | Second |
| 42 | +LL | | } |
| 43 | + | |_^ |
| 44 | + |
| 45 | +error: could not find defining uses |
| 46 | + --> $DIR/reject-opaque_types-in-fields.rs:12:10 |
| 47 | + | |
| 48 | +LL | type X = impl Iterator<Item = u64> + Unpin; |
| 49 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 50 | + |
| 51 | +error: type alias impl traits are not allowed as field types in structs |
| 52 | + --> $DIR/reject-opaque_types-in-fields.rs:15:1 |
| 53 | + | |
| 54 | +LL | type X = impl Iterator<Item = u64> + Unpin; |
| 55 | + | ------------------------------------------- type alias defined here |
| 56 | +... |
| 57 | +LL | struct Foo(X); |
| 58 | + | ^^^^^^^^^^^-^^ |
| 59 | + | | |
| 60 | + | this field contains a type alias impl trait |
| 61 | + |
| 62 | +error: type alias impl traits are not allowed as field types in structs |
| 63 | + --> $DIR/reject-opaque_types-in-fields.rs:25:1 |
| 64 | + | |
| 65 | +LL | type X = impl Iterator<Item = u64> + Unpin; |
| 66 | + | ------------------------------------------- type alias defined here |
| 67 | +... |
| 68 | +LL | struct Bar {a : X} |
| 69 | + | ^^^^^^^^^^^^-----^ |
| 70 | + | | |
| 71 | + | this field contains a type alias impl trait |
| 72 | + |
| 73 | +error: type alias impl traits are not allowed as field types in unions |
| 74 | + --> $DIR/reject-opaque_types-in-fields.rs:35:1 |
| 75 | + | |
| 76 | +LL | type X = impl Iterator<Item = u64> + Unpin; |
| 77 | + | ------------------------------------------- type alias defined here |
| 78 | +... |
| 79 | +LL | / union MyUnion { |
| 80 | +LL | | |
| 81 | +LL | | a: X, |
| 82 | + | | ---- this field contains a type alias impl trait |
| 83 | +LL | | |
| 84 | +LL | | } |
| 85 | + | |_^ |
| 86 | + |
| 87 | +error[E0740]: unions may not contain fields that need dropping |
| 88 | + --> $DIR/reject-opaque_types-in-fields.rs:37:3 |
| 89 | + | |
| 90 | +LL | a: X, |
| 91 | + | ^^^^ |
| 92 | + | |
| 93 | +note: `std::mem::ManuallyDrop` can be used to wrap the type |
| 94 | + --> $DIR/reject-opaque_types-in-fields.rs:37:3 |
| 95 | + | |
| 96 | +LL | a: X, |
| 97 | + | ^^^^ |
| 98 | + |
| 99 | +error: aborting due to 9 previous errors |
| 100 | + |
| 101 | +Some errors have detailed explanations: E0308, E0740. |
| 102 | +For more information about an error, try `rustc --explain E0308`. |
0 commit comments