You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
92
-
--> $DIR/inside-adt.rs:20:15
92
+
--> $DIR/inside-adt.rs:21:15
93
93
|
94
-
LL | union U1 { f: dyn Iterator<Item: Copy> }
95
-
| ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
94
+
LL | union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
95
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
96
96
|
97
-
= help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
97
+
= help: within `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Copy> + 'static)`
98
+
= note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Copy> + 'static)>`
98
99
= note: no field of a union may have a dynamically sized type
99
100
= help: change the field's type to have a statically known size
100
101
help: borrowed types always have a statically known size
101
102
|
102
-
LL | union U1 { f: &dyn Iterator<Item: Copy> }
103
+
LL | union U1 { f: &ManuallyDrop<dyn Iterator<Item: Copy>> }
103
104
| +
104
105
help: the `Box` type always has a statically known size and allocates its contents in the heap
105
106
|
106
-
LL | union U1 { f: Box<dyn Iterator<Item: Copy>> }
107
-
| ++++ +
107
+
LL | union U1 { f: Box<ManuallyDrop<dyn Iterator<Item: Copy>>> }
108
+
| ++++ +
108
109
109
110
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
110
-
--> $DIR/inside-adt.rs:25:15
111
+
--> $DIR/inside-adt.rs:26:15
111
112
|
112
-
LL | union U3 { f: dyn Iterator<Item: 'static> }
113
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
113
+
LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
114
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
114
115
|
115
-
= help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)`
116
+
= help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)`
117
+
= note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized> + 'static)>`
116
118
= note: no field of a union may have a dynamically sized type
117
119
= help: change the field's type to have a statically known size
118
120
help: borrowed types always have a statically known size
119
121
|
120
-
LL | union U3 { f: &dyn Iterator<Item: 'static> }
122
+
LL | union U3 { f: &ManuallyDrop<dyn Iterator<Item: 'static>> }
121
123
| +
122
124
help: the `Box` type always has a statically known size and allocates its contents in the heap
123
125
|
124
-
LL | union U3 { f: Box<dyn Iterator<Item: 'static>> }
125
-
| ++++ +
126
+
LL | union U3 { f: Box<ManuallyDrop<dyn Iterator<Item: 'static>>> }
0 commit comments