@@ -461,10 +461,13 @@ impl<T> [T] {
461
461
#[ rustc_allow_incoherent_impl]
462
462
#[ inline]
463
463
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
464
- pub fn to_vec_in < A : Allocator > ( & self , alloc : A ) -> Vec < T , A >
464
+ pub fn to_vec_in < A : Allocator , const COOP_PREFERRED : bool > (
465
+ & self ,
466
+ alloc : A ,
467
+ ) -> Vec < T , A , COOP_PREFERRED >
465
468
where
466
469
T : Clone ,
467
- [ ( ) ; core:: alloc:: co_alloc_metadata_num_slots :: < A > ( ) ] : ,
470
+ [ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
468
471
{
469
472
// N.B., see the `hack` module in this file for more details.
470
473
hack:: to_vec ( self , alloc)
@@ -487,9 +490,11 @@ impl<T> [T] {
487
490
#[ rustc_allow_incoherent_impl]
488
491
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
489
492
#[ inline]
490
- pub fn into_vec < A : Allocator > ( self : Box < Self , A > ) -> Vec < T , A >
493
+ pub fn into_vec < A : Allocator , const COOP_PREFERRED : bool > (
494
+ self : Box < Self , A > ,
495
+ ) -> Vec < T , A , COOP_PREFERRED >
491
496
where
492
- [ ( ) ; core:: alloc:: co_alloc_metadata_num_slots :: < A > ( ) ] : ,
497
+ [ ( ) ; core:: alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
493
498
{
494
499
// N.B., see the `hack` module in this file for more details.
495
500
hack:: into_vec ( self )
@@ -734,6 +739,7 @@ pub trait Join<Separator> {
734
739
fn join ( slice : & Self , sep : Separator ) -> Self :: Output ;
735
740
}
736
741
742
+ // COOP_NOT_POSSIBLE
737
743
#[ cfg( not( no_global_oom_handling) ) ]
738
744
#[ unstable( feature = "slice_concat_ext" , issue = "27747" ) ]
739
745
impl < T : Clone , V : Borrow < [ T ] > > Concat < T > for [ V ] {
@@ -749,6 +755,7 @@ impl<T: Clone, V: Borrow<[T]>> Concat<T> for [V] {
749
755
}
750
756
}
751
757
758
+ // COOP_NOT_POSSIBLE
752
759
#[ cfg( not( no_global_oom_handling) ) ]
753
760
#[ unstable( feature = "slice_concat_ext" , issue = "27747" ) ]
754
761
impl < T : Clone , V : Borrow < [ T ] > > Join < & T > for [ V ] {
@@ -772,10 +779,11 @@ impl<T: Clone, V: Borrow<[T]>> Join<&T> for [V] {
772
779
}
773
780
}
774
781
782
+ // COOP_NOT_POSSIBLE
775
783
#[ cfg( not( no_global_oom_handling) ) ]
776
784
#[ unstable( feature = "slice_concat_ext" , issue = "27747" ) ]
777
785
impl < T : Clone , V : Borrow < [ T ] > > Join < & [ T ] > for [ V ] {
778
- type Output = Vec < T > ;
786
+ type Output = Vec < T , Global > ;
779
787
780
788
fn join ( slice : & Self , sep : & [ T ] ) -> Vec < T > {
781
789
let mut iter = slice. iter ( ) ;
@@ -820,6 +828,7 @@ where
820
828
}
821
829
}
822
830
831
+ // COOP_NOT_POSSIBLE
823
832
#[ cfg( not( no_global_oom_handling) ) ]
824
833
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
825
834
impl < T : Clone > ToOwned for [ T ] {
0 commit comments