@@ -79,9 +79,7 @@ use core::cmp::Ordering;
7979use core:: hash:: { Hash , Hasher } ;
8080#[ cfg( not( no_global_oom_handling) ) ]
8181use core:: iter;
82- #[ cfg( not( no_global_oom_handling) ) ]
83- use core:: marker:: Destruct ;
84- use core:: marker:: { Freeze , PhantomData } ;
82+ use core:: marker:: { Destruct , Freeze , PhantomData } ;
8583use core:: mem:: { self , Assume , ManuallyDrop , MaybeUninit , SizedTypeProperties , TransmuteFrom } ;
8684use core:: ops:: { self , Index , IndexMut , Range , RangeBounds } ;
8785use core:: ptr:: { self , NonNull } ;
@@ -2218,7 +2216,8 @@ impl<T, A: Allocator> Vec<T, A> {
22182216 /// [`spare_capacity_mut()`]: Vec::spare_capacity_mut
22192217 #[ inline]
22202218 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
2221- pub unsafe fn set_len ( & mut self , new_len : usize ) {
2219+ #[ rustc_const_unstable( feature = "const_heap" , issue = "79597" ) ]
2220+ pub const unsafe fn set_len ( & mut self , new_len : usize ) {
22222221 ub_checks:: assert_unsafe_precondition!(
22232222 check_library_ub,
22242223 "Vec::set_len requires that new_len <= capacity()" ,
@@ -4288,7 +4287,10 @@ impl<T: Ord, A: Allocator> Ord for Vec<T, A> {
42884287}
42894288
42904289#[ stable( feature = "rust1" , since = "1.0.0" ) ]
4291- unsafe impl < #[ may_dangle] T , A : Allocator > Drop for Vec < T , A > {
4290+ #[ rustc_const_unstable( feature = "const_heap" , issue = "79597" ) ]
4291+ const unsafe impl <#[ may_dangle] T : [ const ] Destruct , A : [ const ] Allocator + [ const ] Destruct > Drop
4292+ for Vec < T , A >
4293+ {
42924294 fn drop ( & mut self ) {
42934295 unsafe {
42944296 // use drop for [T]
@@ -4507,7 +4509,10 @@ impl From<&str> for Vec<u8> {
45074509}
45084510
45094511#[ stable( feature = "array_try_from_vec" , since = "1.48.0" ) ]
4510- impl < T , A : Allocator , const N : usize > TryFrom < Vec < T , A > > for [ T ; N ] {
4512+ #[ rustc_const_unstable( feature = "const_convert" , issue = "143773" ) ]
4513+ const impl <T : [ const ] Destruct , A : [ const ] Allocator + [ const ] Destruct , const N : usize >
4514+ TryFrom < Vec < T , A > > for [ T ; N ]
4515+ {
45114516 type Error = Vec < T , A > ;
45124517
45134518 /// Gets the entire contents of the `Vec<T>` as an array,
0 commit comments