@@ -490,10 +490,7 @@ where
490
490
}
491
491
492
492
impl < O : ops:: Op > Cmd < O > {
493
- fn with_capacity ( nodeid : u64 , op_header : O :: InStruct , len : usize ) -> Box < UninitCmd < O > >
494
- where
495
- Cmd < O > : core:: ptr:: Pointee < Metadata = usize > ,
496
- {
493
+ fn with_capacity ( nodeid : u64 , op_header : O :: InStruct , len : usize ) -> Box < UninitCmd < O > > {
497
494
let mut cmd = unsafe { Self :: new_uninit ( len) } ;
498
495
cmd. in_header = MaybeUninit :: new ( fuse_abi:: InHeader {
499
496
len : core:: mem:: size_of_val ( cmd. as_ref ( ) )
@@ -540,23 +537,20 @@ impl<O: ops::Op> AsSliceU8 for Cmd<O> {
540
537
}
541
538
}
542
539
543
- impl < O : ops:: Op > Cmd < O >
544
- where
545
- Self : core:: ptr:: Pointee < Metadata = usize > ,
546
- {
540
+ impl < O : ops:: Op > Cmd < O > {
547
541
// MaybeUninit does not accept DSTs as type parameter
548
542
unsafe fn new_uninit ( len : usize ) -> Box < UninitCmd < O > > {
549
543
unsafe {
550
- Box :: from_raw ( core:: ptr:: from_raw_parts_mut (
544
+ Box :: from_raw ( core:: ptr:: slice_from_raw_parts_mut (
551
545
alloc (
552
546
Layout :: new :: < PayloadlessCmd < O > > ( )
553
547
. extend ( Layout :: array :: < u8 > ( len) . expect ( "The length is too much." ) )
554
548
. expect ( "The layout size overflowed." )
555
549
. 0 // We don't need the offset of `data_header` inside the type (the second element of the tuple)
556
550
. pad_to_align ( ) ,
557
- ) as * mut ( ) ,
558
- len ,
559
- ) )
551
+ ) ,
552
+ 0 ,
553
+ ) as * mut UninitCmd < O > )
560
554
}
561
555
}
562
556
}
@@ -582,20 +576,20 @@ impl<O: ops::Op> AsSliceU8 for Rsp<O> {}
582
576
583
577
impl < O : ops:: Op > Rsp < O >
584
578
where
585
- Self : core :: ptr :: Pointee < Metadata = usize > ,
579
+ O : ops :: Op < OutPayload = [ MaybeUninit < u8 > ] > ,
586
580
{
587
581
unsafe fn new_uninit ( len : usize ) -> Box < Self > {
588
582
unsafe {
589
- Box :: from_raw ( core:: ptr:: from_raw_parts_mut (
583
+ Box :: from_raw ( core:: ptr:: slice_from_raw_parts_mut (
590
584
alloc (
591
585
Layout :: new :: < PayloadlessRsp < O > > ( )
592
586
. extend ( Layout :: array :: < u8 > ( len) . expect ( "The length is too much." ) )
593
587
. expect ( "The layout size overflowed." )
594
588
. 0 // We don't need the offset of `data_header` inside the type (the second element of the tuple)
595
589
. pad_to_align ( ) ,
596
- ) as * mut ( ) ,
597
- len ,
598
- ) )
590
+ ) ,
591
+ 0 ,
592
+ ) as * mut Rsp < O > )
599
593
}
600
594
}
601
595
}
0 commit comments