File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ impl AllocBytes for MiriAllocBytes {
84
84
fn from_bytes < ' a > ( slice : impl Into < Cow < ' a , [ u8 ] > > , align : Align ) -> Self {
85
85
let slice = slice. into ( ) ;
86
86
let size = slice. len ( ) ;
87
- let align = align. bytes ( ) . try_into ( ) . unwrap ( ) ;
87
+ let align = align. bytes_usize ( ) ;
88
88
// SAFETY: `alloc_fn` will only be used if `size != 0`.
89
89
let alloc_fn = |layout| unsafe { alloc:: alloc ( layout) } ;
90
90
let alloc_bytes = MiriAllocBytes :: alloc_with ( size, align, alloc_fn)
@@ -97,7 +97,7 @@ impl AllocBytes for MiriAllocBytes {
97
97
98
98
fn zeroed ( size : Size , align : Align ) -> Option < Self > {
99
99
let size = size. bytes_usize ( ) ;
100
- let align = align. bytes ( ) . try_into ( ) . unwrap ( ) ;
100
+ let align = align. bytes_usize ( ) ;
101
101
// SAFETY: `alloc_fn` will only be used if `size != 0`.
102
102
let alloc_fn = |layout| unsafe { alloc:: alloc_zeroed ( layout) } ;
103
103
MiriAllocBytes :: alloc_with ( size, align, alloc_fn) . ok ( )
You can’t perform that action at this time.
0 commit comments