File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use core::{
20
20
#[ cfg( feature = "serde" ) ]
21
21
use serde:: { Deserialize , Serialize } ;
22
22
#[ cfg( feature = "zerocopy" ) ]
23
- use zerocopy:: { FromBytes , IntoBytes } ;
23
+ use zerocopy:: { FromBytes , Immutable , IntoBytes , KnownLayout } ;
24
24
25
25
pub ( crate ) mod convert;
26
26
@@ -42,7 +42,10 @@ pub(crate) mod convert;
42
42
) ]
43
43
#[ cfg_attr( feature = "rkyv" , rkyv( resolver = Bf16Resolver ) ) ]
44
44
#[ cfg_attr( feature = "bytemuck" , derive( Zeroable , Pod ) ) ]
45
- #[ cfg_attr( feature = "zerocopy" , derive( IntoBytes , FromBytes ) ) ]
45
+ #[ cfg_attr(
46
+ feature = "zerocopy" ,
47
+ derive( FromBytes , Immutable , IntoBytes , KnownLayout )
48
+ ) ]
46
49
#[ cfg_attr( kani, derive( kani:: Arbitrary ) ) ]
47
50
pub struct bf16 ( u16 ) ;
48
51
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ use core::{
20
20
#[ cfg( feature = "serde" ) ]
21
21
use serde:: { Deserialize , Serialize } ;
22
22
#[ cfg( feature = "zerocopy" ) ]
23
- use zerocopy:: { FromBytes , IntoBytes } ;
23
+ use zerocopy:: { FromBytes , Immutable , IntoBytes , KnownLayout } ;
24
24
25
25
pub ( crate ) mod arch;
26
26
@@ -41,7 +41,10 @@ pub(crate) mod arch;
41
41
) ]
42
42
#[ cfg_attr( feature = "rkyv" , rkyv( resolver = F16Resolver ) ) ]
43
43
#[ cfg_attr( feature = "bytemuck" , derive( Zeroable , Pod ) ) ]
44
- #[ cfg_attr( feature = "zerocopy" , derive( IntoBytes , FromBytes ) ) ]
44
+ #[ cfg_attr(
45
+ feature = "zerocopy" ,
46
+ derive( FromBytes , Immutable , IntoBytes , KnownLayout )
47
+ ) ]
45
48
#[ cfg_attr( kani, derive( kani:: Arbitrary ) ) ]
46
49
#[ cfg_attr( feature = "arbitrary" , derive( arbitrary:: Arbitrary ) ) ]
47
50
pub struct f16 ( u16 ) ;
You can’t perform that action at this time.
0 commit comments