Skip to content

Commit d58e1f8

Browse files
CoAlloc: Vec + related (Allocator, GlobalAlloc, proc_macro; vec/macros).
1 parent 79bffdd commit d58e1f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1838
-825
lines changed

compiler/rustc_arena/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
1212
test(no_crate_inject, attr(deny(warnings)))
1313
)]
14+
#![allow(incomplete_features)]
1415
#![feature(dropck_eyepatch)]
1516
#![feature(new_uninit)]
1617
#![feature(maybe_uninit_slice)]
17-
#![feature(min_specialization)]
18+
//#![feature(min_specialization)]
19+
#![feature(specialization)]
1820
#![feature(decl_macro)]
1921
#![feature(pointer_byte_offsets)]
2022
#![feature(rustc_attrs)]

compiler/rustc_ast/src/ast.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub use UnsafeSource::*;
2626
use crate::ptr::P;
2727
use crate::token::{self, CommentKind, Delimiter};
2828
use crate::tokenstream::{DelimSpan, LazyAttrTokenStream, TokenStream};
29-
use core::alloc::GlobalCoAllocMeta;
3029
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
3130
use rustc_data_structures::stack::ensure_sufficient_stack;
3231
use rustc_data_structures::sync::Lrc;
@@ -35,6 +34,8 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
3534
use rustc_span::source_map::{respan, Spanned};
3635
use rustc_span::symbol::{kw, sym, Ident, Symbol};
3736
use rustc_span::{Span, DUMMY_SP};
37+
use std::alloc::Allocator;
38+
use std::alloc::Global;
3839
use std::fmt;
3940
use std::mem;
4041
use thin_vec::{thin_vec, ThinVec};
@@ -3117,26 +3118,26 @@ mod size_asserts {
31173118
static_assert_size!(AssocItem, 104);
31183119
static_assert_size!(AssocItemKind, 32);
31193120
static_assert_size!(Attribute, 32);
3120-
static_assert_size!(Block, 32 + mem::size_of::<GlobalCoAllocMeta>());
3121-
static_assert_size!(Expr, 72 + mem::size_of::<GlobalCoAllocMeta>());
3122-
static_assert_size!(ExprKind, 40 + mem::size_of::<GlobalCoAllocMeta>());
3123-
static_assert_size!(Fn, 152 + 2 * mem::size_of::<GlobalCoAllocMeta>());
3121+
static_assert_size!(Block, 32 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3122+
static_assert_size!(Expr, 72 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3123+
static_assert_size!(ExprKind, 40 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3124+
static_assert_size!(Fn, 152 + 2 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31243125
static_assert_size!(ForeignItem, 96);
31253126
static_assert_size!(ForeignItemKind, 24);
31263127
static_assert_size!(GenericArg, 24);
3127-
static_assert_size!(GenericBound, 56 + mem::size_of::<GlobalCoAllocMeta>());
3128-
static_assert_size!(Generics, 40 + 2 * mem::size_of::<GlobalCoAllocMeta>());
3129-
static_assert_size!(Impl, 136 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3130-
static_assert_size!(Item, 136 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3131-
static_assert_size!(ItemKind, 64 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3128+
static_assert_size!(GenericBound, 56 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3129+
static_assert_size!(Generics, 40 + 2 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3130+
static_assert_size!(Impl, 136 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3131+
static_assert_size!(Item, 136 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3132+
static_assert_size!(ItemKind, 64 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31323133
static_assert_size!(LitKind, 24);
31333134
static_assert_size!(Local, 72);
31343135
static_assert_size!(MetaItemLit, 40);
31353136
static_assert_size!(Param, 40);
3136-
static_assert_size!(Pat, 72 + mem::size_of::<GlobalCoAllocMeta>());
3137+
static_assert_size!(Pat, 72 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31373138
static_assert_size!(Path, 24);
31383139
static_assert_size!(PathSegment, 24);
3139-
static_assert_size!(PatKind, 48 + mem::size_of::<GlobalCoAllocMeta>());
3140+
static_assert_size!(PatKind, 48 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31403141
static_assert_size!(Stmt, 32);
31413142
static_assert_size!(StmtKind, 16);
31423143
static_assert_size!(Ty, 64);

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
99
test(attr(deny(warnings)))
1010
)]
11+
#![feature(allocator_api)]
1112
#![feature(associated_type_bounds)]
1213
#![feature(box_patterns)]
1314
#![feature(const_default_impls)]

compiler/rustc_parse/src/parser/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ pub struct Parser<'a> {
166166
// This type is used a lot, e.g. it's cloned when matching many declarative macro rules with nonterminals. Make sure
167167
// it doesn't unintentionally get bigger.
168168
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
169-
rustc_data_structures::static_assert_size!(Parser<'_>, 288 + 4 * mem::size_of::<GlobalCoAllocMeta>());
169+
rustc_data_structures::static_assert_size!(
170+
Parser<'_>,
171+
288 + 4 * mem::size_of::<GlobalCoAllocMeta>()
172+
);
170173

171174
/// Stores span information about a closure.
172175
#[derive(Clone)]

library/alloc/src/boxed.rs

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
147147
#![stable(feature = "rust1", since = "1.0.0")]
148148

149+
use crate::co_alloc::CoAllocPref;
149150
use core::any::Any;
150151
use core::async_iter::AsyncIterator;
151152
use core::borrow;
@@ -641,7 +642,9 @@ impl<T> Box<[T]> {
641642
#[must_use]
642643
pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
643644
// false = no need for co-alloc metadata, since it would get lost once converted to Box.
644-
unsafe { RawVec::<T, Global, false>::with_capacity(len).into_box(len) }
645+
unsafe {
646+
RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::with_capacity(len).into_box(len)
647+
}
645648
}
646649

647650
/// Constructs a new boxed slice with uninitialized contents, with the memory
@@ -667,7 +670,10 @@ impl<T> Box<[T]> {
667670
#[must_use]
668671
pub fn new_zeroed_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
669672
// false = no need for co-alloc metadata, since it would get lost once converted to Box.
670-
unsafe { RawVec::<T, Global, false>::with_capacity_zeroed(len).into_box(len) }
673+
unsafe {
674+
RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::with_capacity_zeroed(len)
675+
.into_box(len)
676+
}
671677
}
672678

673679
/// Constructs a new boxed slice with uninitialized contents. Returns an error if
@@ -699,7 +705,7 @@ impl<T> Box<[T]> {
699705
Err(_) => return Err(AllocError),
700706
};
701707
let ptr = Global.allocate(layout)?;
702-
Ok(RawVec::<T, Global, false>::from_raw_parts_in(
708+
Ok(RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::from_raw_parts_in(
703709
ptr.as_mut_ptr() as *mut _,
704710
len,
705711
Global,
@@ -736,7 +742,7 @@ impl<T> Box<[T]> {
736742
Err(_) => return Err(AllocError),
737743
};
738744
let ptr = Global.allocate_zeroed(layout)?;
739-
Ok(RawVec::<T, Global, false>::from_raw_parts_in(
745+
Ok(RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::from_raw_parts_in(
740746
ptr.as_mut_ptr() as *mut _,
741747
len,
742748
Global,
@@ -746,9 +752,10 @@ impl<T> Box<[T]> {
746752
}
747753
}
748754

755+
#[allow(unused_braces)]
749756
impl<T, A: Allocator> Box<[T], A>
750757
where
751-
[(); core::alloc::co_alloc_metadata_num_slots::<A>()]:,
758+
[(); { crate::meta_num_slots!(A, crate::CO_ALLOC_PREF_META_NO!()) }]:,
752759
{
753760
/// Constructs a new boxed slice with uninitialized contents in the provided allocator.
754761
///
@@ -777,12 +784,10 @@ where
777784
// #[unstable(feature = "new_uninit", issue = "63291")]
778785
#[must_use]
779786
#[allow(unused_braces)]
780-
pub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A>
781-
where
782-
// false = no need for co-alloc metadata, since it would get lost once converted to Box.
783-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<A>(false)]:,
784-
{
785-
unsafe { RawVec::<T, A, false>::with_capacity_in(len, alloc).into_box(len) }
787+
pub fn new_uninit_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> {
788+
unsafe {
789+
RawVec::<T, A, { CO_ALLOC_PREF_META_NO!() }>::with_capacity_in(len, alloc).into_box(len)
790+
}
786791
}
787792

788793
/// Constructs a new boxed slice with uninitialized contents in the provided allocator,
@@ -810,12 +815,11 @@ where
810815
// #[unstable(feature = "new_uninit", issue = "63291")]
811816
#[must_use]
812817
#[allow(unused_braces)]
813-
pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A>
814-
where
815-
// false = no need for co-alloc metadata, since it would get lost once converted to Box.
816-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<A>(false)]:,
817-
{
818-
unsafe { RawVec::<T, A, false>::with_capacity_zeroed_in(len, alloc).into_box(len) }
818+
pub fn new_zeroed_slice_in(len: usize, alloc: A) -> Box<[mem::MaybeUninit<T>], A> {
819+
unsafe {
820+
RawVec::<T, A, { CO_ALLOC_PREF_META_NO!() }>::with_capacity_zeroed_in(len, alloc)
821+
.into_box(len)
822+
}
819823
}
820824
}
821825

@@ -1523,7 +1527,7 @@ impl<T: Copy> From<&[T]> for Box<[T]> {
15231527
fn from(slice: &[T]) -> Box<[T]> {
15241528
let len = slice.len();
15251529
// false = no need for co-alloc metadata, since it would get lost once converted to Box.
1526-
let buf = RawVec::<T, Global, false>::with_capacity(len);
1530+
let buf = RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::with_capacity(len);
15271531
unsafe {
15281532
ptr::copy_nonoverlapping(slice.as_ptr(), buf.ptr(), len);
15291533
buf.into_box(slice.len()).assume_init()
@@ -1687,12 +1691,13 @@ impl<T, const N: usize> TryFrom<Box<[T]>> for Box<[T; N]> {
16871691

16881692
#[cfg(not(no_global_oom_handling))]
16891693
#[stable(feature = "boxed_array_try_from_vec", since = "1.66.0")]
1690-
impl<T, const N: usize, const COOP_PREFERRED: bool> TryFrom<Vec<T, Global, COOP_PREFERRED>>
1694+
#[allow(unused_braces)]
1695+
impl<T, const N: usize, const CO_ALLOC_PREF: CoAllocPref> TryFrom<Vec<T, Global, CO_ALLOC_PREF>>
16911696
for Box<[T; N]>
16921697
where
1693-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1698+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
16941699
{
1695-
type Error = Vec<T, Global, COOP_PREFERRED>;
1700+
type Error = Vec<T, Global, CO_ALLOC_PREF>;
16961701

16971702
/// Attempts to convert a `Vec<T>` into a `Box<[T; N]>`.
16981703
///
@@ -1712,7 +1717,7 @@ where
17121717
/// let state: Box<[f32; 100]> = vec![1.0; 100].try_into().unwrap();
17131718
/// assert_eq!(state.len(), 100);
17141719
/// ```
1715-
fn try_from(vec: Vec<T, Global, COOP_PREFERRED>) -> Result<Self, Self::Error> {
1720+
fn try_from(vec: Vec<T, Global, CO_ALLOC_PREF>) -> Result<Self, Self::Error> {
17161721
if vec.len() == N {
17171722
let boxed_slice = vec.into_boxed_slice();
17181723
Ok(unsafe { boxed_slice_as_array_unchecked(boxed_slice) })
@@ -2049,14 +2054,15 @@ impl<I> FromIterator<I> for Box<[I]> {
20492054

20502055
#[cfg(not(no_global_oom_handling))]
20512056
#[stable(feature = "box_slice_clone", since = "1.3.0")]
2057+
#[allow(unused_braces)]
20522058
impl<T: Clone, A: Allocator + Clone> Clone for Box<[T], A>
20532059
where
2054-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<A>(false)]:,
2060+
[(); { crate::meta_num_slots!(A, crate::CO_ALLOC_PREF_META_NO!()) }]:,
20552061
{
20562062
fn clone(&self) -> Self {
20572063
let alloc = Box::allocator(self).clone();
20582064
// false = no need for co-alloc metadata, since it would get lost once converted to the boxed slice.
2059-
self.to_vec_in::<A, false>(alloc).into_boxed_slice()
2065+
self.to_vec_in_co::<A, { CO_ALLOC_PREF_META_NO!() }>(alloc).into_boxed_slice()
20602066
}
20612067

20622068
fn clone_from(&mut self, other: &Self) {

library/alloc/src/co_alloc.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//! CoAlloction-specific types that only apply in heap-based applications (hence not a part of
2+
//! [::core]).
3+
//!
4+
//! Types here have names with `CoAlloc` prefix. Yes, when using a q ualified path (like
5+
//! ::alloc::co_alloc::CoAllocPref), that involves "stuttering", which is not recommended.
6+
//!
7+
//! However, as per Rust Book the common practice is to import type names fully and access them just
8+
//! with their name (except for cases of conflict). And we don't want the type names any shorter
9+
//! (such `Pref`), because thoe would be vague/confusing.
10+
11+
/// `CoAllocPref` values indicate a type's preference for coallocation (in either user space, or
12+
/// `std` space). Used as a `const` generic parameter type (usually called `CO_ALLOC_PREF`).
13+
///
14+
/// The actual value may be overriden by the allocator. See also `CoAllocMetaNumSlotsPref` and
15+
/// `co_alloc_pref` macro .
16+
///
17+
/// This type WILL CHANGE (once ``#![feature(generic_const_exprs)]` and
18+
/// `#![feature(adt_const_params)]` are stable) to a dedicated struct/enum. Hence:
19+
/// - DO NOT construct instances, but use `co_alloc_pref` macro together with constants
20+
/// `CO_ALLOC_PREF_META_YES` and `CO_ALLOC_PREF_META_NO`;
21+
/// - DO NOT hard code any values; and
22+
/// - DO NOT mix this/cast this with/to `u8`, `u16`, `usize` (nor any other integer).
23+
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
24+
pub type CoAllocPref = usize; //u8;
25+
26+
/// `CoAllocMetaNumSlotsPref` values indicate that a type (but not necessarily an allocator) prefers
27+
/// to coallocate by carrying metadata, or not. (In either user space, or `std` or `alloc` space).
28+
/// Used as an argument to macro call of `co_alloc_pref`, which generates a `CoAllocPref` value.
29+
///
30+
/// Currently this indicates only the (preferred) number of `CoAllocMetaBase` slots being used
31+
/// (either 1 = coallocation, or 0 = no coallocation). However, in the future this type may have
32+
/// other properties (serving as extra hints to the allocator).
33+
///
34+
/// The actual value may be overriden by the allocator. For example, if the allocator doesn't
35+
/// support coallocation, then whether this value prefers to coallocate or not makes no difference.
36+
///
37+
/// This type WILL CHANGE (once ``#![feature(generic_const_exprs)]` and
38+
/// `#![feature(adt_const_params)]` are stable) to a dedicated struct/enum. Hence:
39+
/// - DO NOT mix this/cast this with/to `u8`, `u16`, (nor any other integer); and
40+
/// - DO NOT hard code any values, but use `CO_ALLOC_PREF_META_YES` and `CO_ALLOC_PREF_META_NO`.
41+
///
42+
/// This type is intentionally not `u16`, `u32`, nor `usize`. Why? This helps to prevent mistakes
43+
/// when one would use `CO_ALLOC_PREF_META_YES` or `CO_ALLOC_PREF_META_NO` in place of `CoAllocPref`
44+
/// vales, or in place of a result of `meta_num_slots` macro. That also prevents mixing up with
45+
/// [core::alloc::CoAllocatorMetaNumSlots].
46+
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
47+
pub type CoAllocMetaNumSlotsPref = u16;

library/alloc/src/collections/binary_heap/mod.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@
143143
#![allow(missing_docs)]
144144
#![stable(feature = "rust1", since = "1.0.0")]
145145

146+
use crate::co_alloc::CoAllocPref;
146147
use core::fmt;
147148
use core::iter::{FromIterator, FusedIterator, InPlaceIterable, SourceIter, TrustedLen};
148149
use core::mem::{self, swap, ManuallyDrop};
@@ -155,7 +156,7 @@ use crate::alloc::Global;
155156
use crate::collections::TryReserveError;
156157
use crate::slice;
157158
use crate::vec::{self, AsVecIntoIter, Vec};
158-
use crate::DEFAULT_COOP_PREFERRED;
159+
use crate::CO_ALLOC_PREF_DEFAULT;
159160

160161
use super::SpecExtend;
161162

@@ -1257,7 +1258,7 @@ impl<T> BinaryHeap<T> {
12571258
#[inline]
12581259
#[stable(feature = "drain", since = "1.6.0")]
12591260
#[allow(unused_braces)]
1260-
pub fn drain(&mut self) -> Drain<'_, T, { SHORT_TERM_VEC_PREFERS_COOP!() }> {
1261+
pub fn drain(&mut self) -> Drain<'_, T, { SHORT_TERM_VEC_CO_ALLOC_PREF!() }> {
12611262
Drain { iter: self.data.drain(..) }
12621263
}
12631264

@@ -1537,17 +1538,19 @@ unsafe impl<T: Ord> TrustedLen for IntoIterSorted<T> {}
15371538
/// [`drain`]: BinaryHeap::drain
15381539
#[stable(feature = "drain", since = "1.6.0")]
15391540
#[derive(Debug)]
1540-
pub struct Drain<'a, T: 'a, const COOP_PREFERRED: bool>
1541+
#[allow(unused_braces)]
1542+
pub struct Drain<'a, T: 'a, const CO_ALLOC_PREF: CoAllocPref>
15411543
where
1542-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1544+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15431545
{
1544-
iter: vec::Drain<'a, T, Global, COOP_PREFERRED>,
1546+
iter: vec::Drain<'a, T, Global, CO_ALLOC_PREF>,
15451547
}
15461548

15471549
#[stable(feature = "drain", since = "1.6.0")]
1548-
impl<T, const COOP_PREFERRED: bool> Iterator for Drain<'_, T, COOP_PREFERRED>
1550+
#[allow(unused_braces)]
1551+
impl<T, const CO_ALLOC_PREF: CoAllocPref> Iterator for Drain<'_, T, CO_ALLOC_PREF>
15491552
where
1550-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1553+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15511554
{
15521555
type Item = T;
15531556

@@ -1563,9 +1566,10 @@ where
15631566
}
15641567

15651568
#[stable(feature = "drain", since = "1.6.0")]
1566-
impl<T, const COOP_PREFERRED: bool> DoubleEndedIterator for Drain<'_, T, COOP_PREFERRED>
1569+
#[allow(unused_braces)]
1570+
impl<T, const CO_ALLOC_PREF: CoAllocPref> DoubleEndedIterator for Drain<'_, T, CO_ALLOC_PREF>
15671571
where
1568-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1572+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15691573
{
15701574
#[inline]
15711575
fn next_back(&mut self) -> Option<T> {
@@ -1574,18 +1578,20 @@ where
15741578
}
15751579

15761580
#[stable(feature = "drain", since = "1.6.0")]
1577-
impl<T, const COOP_PREFERRED: bool> ExactSizeIterator for Drain<'_, T, COOP_PREFERRED>
1581+
#[allow(unused_braces)]
1582+
impl<T, const CO_ALLOC_PREF: CoAllocPref> ExactSizeIterator for Drain<'_, T, CO_ALLOC_PREF>
15781583
where
1579-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1584+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15801585
{
15811586
fn is_empty(&self) -> bool {
15821587
self.iter.is_empty()
15831588
}
15841589
}
15851590

15861591
#[stable(feature = "fused", since = "1.26.0")]
1587-
impl<T, const COOP_PREFERRED: bool> FusedIterator for Drain<'_, T, COOP_PREFERRED> where
1588-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:
1592+
#[allow(unused_braces)]
1593+
impl<T, const CO_ALLOC_PREF: CoAllocPref> FusedIterator for Drain<'_, T, CO_ALLOC_PREF> where
1594+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:
15891595
{
15901596
}
15911597

@@ -1676,7 +1682,7 @@ impl<T: Ord, const N: usize> From<[T; N]> for BinaryHeap<T> {
16761682

16771683
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
16781684
#[allow(unused_braces)]
1679-
impl<T> From<BinaryHeap<T>> for Vec<T, Global, { DEFAULT_COOP_PREFERRED!() }> {
1685+
impl<T> From<BinaryHeap<T>> for Vec<T, Global, { CO_ALLOC_PREF_DEFAULT!() }> {
16801686
/// Converts a `BinaryHeap<T>` into a `Vec<T>`.
16811687
///
16821688
/// This conversion requires no data movement or allocation, and has

0 commit comments

Comments
 (0)