@@ -159,10 +159,7 @@ fn derive_from_zeros_enum(ctx: &Ctx, enm: &DataEnum) -> Result<TokenStream, Erro
159159 . build ( ) )
160160}
161161fn derive_from_zeros_union ( ctx : & Ctx , unn : & DataUnion ) -> TokenStream {
162- // FIXME(#5): Remove the `Immutable` bound. It's only necessary for
163- // compatibility with `derive(TryFromBytes)` on unions; not for soundness.
164- let field_type_trait_bounds =
165- FieldBounds :: All ( & [ TraitBound :: Slf , TraitBound :: Other ( Trait :: Immutable ) ] ) ;
162+ let field_type_trait_bounds = FieldBounds :: All ( & [ TraitBound :: Slf ] ) ;
166163 ImplBlockBuilder :: new ( ctx, unn, Trait :: FromZeros , field_type_trait_bounds) . build ( )
167164}
168165fn derive_from_bytes_struct ( ctx : & Ctx , strct : & DataStruct ) -> TokenStream {
@@ -186,9 +183,6 @@ fn derive_from_bytes_enum(ctx: &Ctx, enm: &DataEnum) -> Result<TokenStream, Erro
186183 Ok ( ImplBlockBuilder :: new ( ctx, enm, Trait :: FromBytes , FieldBounds :: ALL_SELF ) . build ( ) )
187184}
188185fn derive_from_bytes_union ( ctx : & Ctx , unn : & DataUnion ) -> TokenStream {
189- // FIXME(#5): Remove the `Immutable` bound. It's only necessary for
190- // compatibility with `derive(TryFromBytes)` on unions; not for soundness.
191- let field_type_trait_bounds =
192- FieldBounds :: All ( & [ TraitBound :: Slf , TraitBound :: Other ( Trait :: Immutable ) ] ) ;
186+ let field_type_trait_bounds = FieldBounds :: All ( & [ TraitBound :: Slf ] ) ;
193187 ImplBlockBuilder :: new ( ctx, unn, Trait :: FromBytes , field_type_trait_bounds) . build ( )
194188}
0 commit comments