Skip to content

Commit 3139f35

Browse files
CoAlloc: Vec + related (Allocator, GlobalAlloc, proc_macro; vec/macros).
1 parent 91aa52b commit 3139f35

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};
@@ -3112,26 +3113,26 @@ mod size_asserts {
31123113
static_assert_size!(AssocItem, 104);
31133114
static_assert_size!(AssocItemKind, 32);
31143115
static_assert_size!(Attribute, 32);
3115-
static_assert_size!(Block, 48 + mem::size_of::<GlobalCoAllocMeta>());
3116-
static_assert_size!(Expr, 72 + mem::size_of::<GlobalCoAllocMeta>());
3117-
static_assert_size!(ExprKind, 40 + mem::size_of::<GlobalCoAllocMeta>());
3118-
static_assert_size!(Fn, 184 + 2 * mem::size_of::<GlobalCoAllocMeta>());
3116+
static_assert_size!(Block, 48 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3117+
static_assert_size!(Expr, 72 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3118+
static_assert_size!(ExprKind, 40 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3119+
static_assert_size!(Fn, 184 + 2 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31193120
static_assert_size!(ForeignItem, 96);
31203121
static_assert_size!(ForeignItemKind, 24);
31213122
static_assert_size!(GenericArg, 24);
3122-
static_assert_size!(GenericBound, 72 + mem::size_of::<GlobalCoAllocMeta>());
3123-
static_assert_size!(Generics, 72 + 2 * mem::size_of::<GlobalCoAllocMeta>());
3124-
static_assert_size!(Impl, 184 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3125-
static_assert_size!(Item, 184 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3126-
static_assert_size!(ItemKind, 112 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3123+
static_assert_size!(GenericBound, 72 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3124+
static_assert_size!(Generics, 72 + 2 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3125+
static_assert_size!(Impl, 184 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3126+
static_assert_size!(Item, 184 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3127+
static_assert_size!(ItemKind, 112 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31273128
static_assert_size!(LitKind, 24);
31283129
static_assert_size!(Local, 72);
31293130
static_assert_size!(MetaItemLit, 40);
31303131
static_assert_size!(Param, 40);
3131-
static_assert_size!(Pat, 88 + mem::size_of::<GlobalCoAllocMeta>());
3132+
static_assert_size!(Pat, 88 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31323133
static_assert_size!(Path, 24);
31333134
static_assert_size!(PathSegment, 24);
3134-
static_assert_size!(PatKind, 64 + mem::size_of::<GlobalCoAllocMeta>());
3135+
static_assert_size!(PatKind, 64 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31353136
static_assert_size!(Stmt, 32);
31363137
static_assert_size!(StmtKind, 16);
31373138
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
@@ -168,7 +168,10 @@ pub struct Parser<'a> {
168168
// This type is used a lot, e.g. it's cloned when matching many declarative macro rules with nonterminals. Make sure
169169
// it doesn't unintentionally get bigger.
170170
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
171-
rustc_data_structures::static_assert_size!(Parser<'_>, 312 + 4 * mem::size_of::<GlobalCoAllocMeta>());
171+
rustc_data_structures::static_assert_size!(
172+
Parser<'_>,
173+
312 + 4 * mem::size_of::<GlobalCoAllocMeta>()
174+
);
172175

173176
/// Stores span information about a closure.
174177
#[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;
@@ -642,7 +643,9 @@ impl<T> Box<[T]> {
642643
#[must_use]
643644
pub fn new_uninit_slice(len: usize) -> Box<[mem::MaybeUninit<T>]> {
644645
// false = no need for co-alloc metadata, since it would get lost once converted to Box.
645-
unsafe { RawVec::<T, Global, false>::with_capacity(len).into_box(len) }
646+
unsafe {
647+
RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::with_capacity(len).into_box(len)
648+
}
646649
}
647650

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

674680
/// Constructs a new boxed slice with uninitialized contents. Returns an error if
@@ -700,7 +706,7 @@ impl<T> Box<[T]> {
700706
Err(_) => return Err(AllocError),
701707
};
702708
let ptr = Global.allocate(layout)?;
703-
Ok(RawVec::<T, Global, false>::from_raw_parts_in(
709+
Ok(RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::from_raw_parts_in(
704710
ptr.as_mut_ptr() as *mut _,
705711
len,
706712
Global,
@@ -737,7 +743,7 @@ impl<T> Box<[T]> {
737743
Err(_) => return Err(AllocError),
738744
};
739745
let ptr = Global.allocate_zeroed(layout)?;
740-
Ok(RawVec::<T, Global, false>::from_raw_parts_in(
746+
Ok(RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::from_raw_parts_in(
741747
ptr.as_mut_ptr() as *mut _,
742748
len,
743749
Global,
@@ -747,9 +753,10 @@ impl<T> Box<[T]> {
747753
}
748754
}
749755

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

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

@@ -1522,7 +1526,7 @@ impl<T: Copy> From<&[T]> for Box<[T]> {
15221526
fn from(slice: &[T]) -> Box<[T]> {
15231527
let len = slice.len();
15241528
// false = no need for co-alloc metadata, since it would get lost once converted to Box.
1525-
let buf = RawVec::<T, Global, false>::with_capacity(len);
1529+
let buf = RawVec::<T, Global, { CO_ALLOC_PREF_META_NO!() }>::with_capacity(len);
15261530
unsafe {
15271531
ptr::copy_nonoverlapping(slice.as_ptr(), buf.ptr(), len);
15281532
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

@@ -1245,7 +1246,7 @@ impl<T> BinaryHeap<T> {
12451246
#[inline]
12461247
#[stable(feature = "drain", since = "1.6.0")]
12471248
#[allow(unused_braces)]
1248-
pub fn drain(&mut self) -> Drain<'_, T, { SHORT_TERM_VEC_PREFERS_COOP!() }> {
1249+
pub fn drain(&mut self) -> Drain<'_, T, { SHORT_TERM_VEC_CO_ALLOC_PREF!() }> {
12491250
Drain { iter: self.data.drain(..) }
12501251
}
12511252

@@ -1525,17 +1526,19 @@ unsafe impl<T: Ord> TrustedLen for IntoIterSorted<T> {}
15251526
/// [`drain`]: BinaryHeap::drain
15261527
#[stable(feature = "drain", since = "1.6.0")]
15271528
#[derive(Debug)]
1528-
pub struct Drain<'a, T: 'a, const COOP_PREFERRED: bool>
1529+
#[allow(unused_braces)]
1530+
pub struct Drain<'a, T: 'a, const CO_ALLOC_PREF: CoAllocPref>
15291531
where
1530-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1532+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15311533
{
1532-
iter: vec::Drain<'a, T, Global, COOP_PREFERRED>,
1534+
iter: vec::Drain<'a, T, Global, CO_ALLOC_PREF>,
15331535
}
15341536

15351537
#[stable(feature = "drain", since = "1.6.0")]
1536-
impl<T, const COOP_PREFERRED: bool> Iterator for Drain<'_, T, COOP_PREFERRED>
1538+
#[allow(unused_braces)]
1539+
impl<T, const CO_ALLOC_PREF: CoAllocPref> Iterator for Drain<'_, T, CO_ALLOC_PREF>
15371540
where
1538-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1541+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15391542
{
15401543
type Item = T;
15411544

@@ -1551,9 +1554,10 @@ where
15511554
}
15521555

15531556
#[stable(feature = "drain", since = "1.6.0")]
1554-
impl<T, const COOP_PREFERRED: bool> DoubleEndedIterator for Drain<'_, T, COOP_PREFERRED>
1557+
#[allow(unused_braces)]
1558+
impl<T, const CO_ALLOC_PREF: CoAllocPref> DoubleEndedIterator for Drain<'_, T, CO_ALLOC_PREF>
15551559
where
1556-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1560+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15571561
{
15581562
#[inline]
15591563
fn next_back(&mut self) -> Option<T> {
@@ -1562,18 +1566,20 @@ where
15621566
}
15631567

15641568
#[stable(feature = "drain", since = "1.6.0")]
1565-
impl<T, const COOP_PREFERRED: bool> ExactSizeIterator for Drain<'_, T, COOP_PREFERRED>
1569+
#[allow(unused_braces)]
1570+
impl<T, const CO_ALLOC_PREF: CoAllocPref> ExactSizeIterator for Drain<'_, T, CO_ALLOC_PREF>
15661571
where
1567-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:,
1572+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:,
15681573
{
15691574
fn is_empty(&self) -> bool {
15701575
self.iter.is_empty()
15711576
}
15721577
}
15731578

15741579
#[stable(feature = "fused", since = "1.26.0")]
1575-
impl<T, const COOP_PREFERRED: bool> FusedIterator for Drain<'_, T, COOP_PREFERRED> where
1576-
[(); core::alloc::co_alloc_metadata_num_slots_with_preference::<Global>(COOP_PREFERRED)]:
1580+
#[allow(unused_braces)]
1581+
impl<T, const CO_ALLOC_PREF: CoAllocPref> FusedIterator for Drain<'_, T, CO_ALLOC_PREF> where
1582+
[(); { meta_num_slots_global!(CO_ALLOC_PREF) }]:
15771583
{
15781584
}
15791585

@@ -1664,7 +1670,7 @@ impl<T: Ord, const N: usize> From<[T; N]> for BinaryHeap<T> {
16641670

16651671
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
16661672
#[allow(unused_braces)]
1667-
impl<T> From<BinaryHeap<T>> for Vec<T, Global, { DEFAULT_COOP_PREFERRED!() }> {
1673+
impl<T> From<BinaryHeap<T>> for Vec<T, Global, { CO_ALLOC_PREF_DEFAULT!() }> {
16681674
/// Converts a `BinaryHeap<T>` into a `Vec<T>`.
16691675
///
16701676
/// This conversion requires no data movement or allocation, and has

0 commit comments

Comments
 (0)