File tree 3 files changed +3
-35
lines changed
3 files changed +3
-35
lines changed Original file line number Diff line number Diff line change 94
94
#![ feature( ptr_offset_from) ]
95
95
#![ feature( rustc_attrs) ]
96
96
#![ feature( receiver_trait) ]
97
+ #![ feature( slice_from_raw_parts) ]
97
98
#![ feature( specialization) ]
98
99
#![ feature( staged_api) ]
99
100
#![ feature( std_internals) ]
102
103
#![ feature( try_reserve) ]
103
104
#![ feature( unboxed_closures) ]
104
105
#![ feature( unicode_internals) ]
105
- #![ feature( untagged_unions) ]
106
106
#![ feature( unsize) ]
107
107
#![ feature( unsized_locals) ]
108
108
#![ feature( allocator_internals) ]
Original file line number Diff line number Diff line change @@ -764,25 +764,9 @@ impl<T: ?Sized> Rc<T> {
764
764
impl < T > Rc < [ T ] > {
765
765
// Allocates an `RcBox<[T]>` with the given length.
766
766
unsafe fn allocate_for_slice ( len : usize ) -> * mut RcBox < [ T ] > {
767
- // FIXME(#60667): Deduplicate.
768
- fn slice_from_raw_parts_mut < T > ( data : * mut T , len : usize ) -> * mut [ T ] {
769
- #[ repr( C ) ]
770
- union Repr < T > {
771
- rust_mut : * mut [ T ] ,
772
- raw : FatPtr < T > ,
773
- }
774
-
775
- #[ repr( C ) ]
776
- struct FatPtr < T > {
777
- data : * const T ,
778
- len : usize ,
779
- }
780
- unsafe { Repr { raw : FatPtr { data, len } } . rust_mut }
781
- }
782
-
783
767
Self :: allocate_for_unsized (
784
768
Layout :: array :: < T > ( len) . unwrap ( ) ,
785
- |mem| slice_from_raw_parts_mut ( mem as * mut T , len) as * mut RcBox < [ T ] > ,
769
+ |mem| ptr :: slice_from_raw_parts_mut ( mem as * mut T , len) as * mut RcBox < [ T ] > ,
786
770
)
787
771
}
788
772
}
Original file line number Diff line number Diff line change @@ -652,25 +652,9 @@ impl<T: ?Sized> Arc<T> {
652
652
impl < T > Arc < [ T ] > {
653
653
// Allocates an `ArcInner<[T]>` with the given length.
654
654
unsafe fn allocate_for_slice ( len : usize ) -> * mut ArcInner < [ T ] > {
655
- // FIXME(#60667): Deduplicate.
656
- fn slice_from_raw_parts_mut < T > ( data : * mut T , len : usize ) -> * mut [ T ] {
657
- #[ repr( C ) ]
658
- union Repr < T > {
659
- rust_mut : * mut [ T ] ,
660
- raw : FatPtr < T > ,
661
- }
662
-
663
- #[ repr( C ) ]
664
- struct FatPtr < T > {
665
- data : * const T ,
666
- len : usize ,
667
- }
668
- unsafe { Repr { raw : FatPtr { data, len } } . rust_mut }
669
- }
670
-
671
655
Self :: allocate_for_unsized (
672
656
Layout :: array :: < T > ( len) . unwrap ( ) ,
673
- |mem| slice_from_raw_parts_mut ( mem as * mut T , len) as * mut ArcInner < [ T ] > ,
657
+ |mem| ptr :: slice_from_raw_parts_mut ( mem as * mut T , len) as * mut ArcInner < [ T ] > ,
674
658
)
675
659
}
676
660
}
You can’t perform that action at this time.
0 commit comments