@@ -490,10 +490,7 @@ where
490490}
491491
492492impl < 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 > > {
497494 let mut cmd = unsafe { Self :: new_uninit ( len) } ;
498495 cmd. in_header = MaybeUninit :: new ( fuse_abi:: InHeader {
499496 len : core:: mem:: size_of_val ( cmd. as_ref ( ) )
@@ -540,23 +537,20 @@ impl<O: ops::Op> AsSliceU8 for Cmd<O> {
540537 }
541538}
542539
543- impl < O : ops:: Op > Cmd < O >
544- where
545- Self : core:: ptr:: Pointee < Metadata = usize > ,
546- {
540+ impl < O : ops:: Op > Cmd < O > {
547541 // MaybeUninit does not accept DSTs as type parameter
548542 unsafe fn new_uninit ( len : usize ) -> Box < UninitCmd < O > > {
549543 unsafe {
550- Box :: from_raw ( core:: ptr:: from_raw_parts_mut (
544+ Box :: from_raw ( core:: ptr:: slice_from_raw_parts_mut (
551545 alloc (
552546 Layout :: new :: < PayloadlessCmd < O > > ( )
553547 . extend ( Layout :: array :: < u8 > ( len) . expect ( "The length is too much." ) )
554548 . expect ( "The layout size overflowed." )
555549 . 0 // We don't need the offset of `data_header` inside the type (the second element of the tuple)
556550 . pad_to_align ( ) ,
557- ) as * mut ( ) ,
558- len ,
559- ) )
551+ ) ,
552+ 0 ,
553+ ) as * mut UninitCmd < O > )
560554 }
561555 }
562556}
@@ -582,20 +576,20 @@ impl<O: ops::Op> AsSliceU8 for Rsp<O> {}
582576
583577impl < O : ops:: Op > Rsp < O >
584578where
585- Self : core :: ptr :: Pointee < Metadata = usize > ,
579+ O : ops :: Op < OutPayload = [ MaybeUninit < u8 > ] > ,
586580{
587581 unsafe fn new_uninit ( len : usize ) -> Box < Self > {
588582 unsafe {
589- Box :: from_raw ( core:: ptr:: from_raw_parts_mut (
583+ Box :: from_raw ( core:: ptr:: slice_from_raw_parts_mut (
590584 alloc (
591585 Layout :: new :: < PayloadlessRsp < O > > ( )
592586 . extend ( Layout :: array :: < u8 > ( len) . expect ( "The length is too much." ) )
593587 . expect ( "The layout size overflowed." )
594588 . 0 // We don't need the offset of `data_header` inside the type (the second element of the tuple)
595589 . pad_to_align ( ) ,
596- ) as * mut ( ) ,
597- len ,
598- ) )
590+ ) ,
591+ 0 ,
592+ ) as * mut Rsp < O > )
599593 }
600594 }
601595}
0 commit comments