File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 137
137
#![ feature( const_size_of_val) ]
138
138
#![ feature( const_slice_from_raw_parts_mut) ]
139
139
#![ feature( const_slice_ptr_len) ]
140
- #![ feature( const_slice_split_at_not_mut) ]
141
140
#![ feature( const_str_from_utf8_unchecked_mut) ]
142
141
#![ feature( const_swap) ]
143
142
#![ feature( const_trait_impl) ]
150
149
#![ feature( maybe_uninit_uninit_array) ]
151
150
#![ feature( ptr_metadata) ]
152
151
#![ feature( slice_ptr_get) ]
152
+ #![ feature( slice_split_at_unchecked) ]
153
153
#![ feature( str_internals) ]
154
154
#![ feature( utf16_extra) ]
155
155
#![ feature( utf16_extra_const) ]
Original file line number Diff line number Diff line change @@ -1624,10 +1624,14 @@ impl<T> [T] {
1624
1624
/// }
1625
1625
/// ```
1626
1626
#[ unstable( feature = "slice_split_at_unchecked" , reason = "new API" , issue = "76014" ) ]
1627
- #[ rustc_const_unstable( feature = "const_slice_split_at_not_mut " , issue = "none " ) ]
1627
+ #[ rustc_const_unstable( feature = "slice_split_at_unchecked " , issue = "76014 " ) ]
1628
1628
#[ inline]
1629
1629
#[ must_use]
1630
1630
pub const unsafe fn split_at_unchecked ( & self , mid : usize ) -> ( & [ T ] , & [ T ] ) {
1631
+ // HACK: the const function `from_raw_parts` is used to make this
1632
+ // function const; previously the implementation used
1633
+ // `(self.get_unchecked(..mid), self.get_unchecked(mid..))`
1634
+
1631
1635
let len = self . len ( ) ;
1632
1636
let ptr = self . as_ptr ( ) ;
1633
1637
You can’t perform that action at this time.
0 commit comments