Skip to content

Commit

Permalink
CoAlloc: Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lyons-kehl committed Feb 19, 2023
1 parent 388ba85 commit b9f350c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions library/alloc/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ impl<T> [T] {
#[inline]
#[allow(unused_braces)]
pub fn into_vec<A: Allocator>(self: Box<Self, A>) -> Vec<T, A>
where [(); { crate::meta_num_slots!(A, CO_ALLOC_PREF) }]:
where [(); { crate::meta_num_slots_default!(A) }]:
{
// N.B., see the `hack` module in this file for more details.
hack::into_vec(self)
Expand Down Expand Up @@ -986,15 +986,15 @@ where
#[cfg(not(no_global_oom_handling))]
#[allow(unused_braces)]
pub(crate) trait SpecCloneIntoVec<T, A: Allocator>
where [(); { crate::meta_num_slots!(A, CO_ALLOC_PREF) }]:
where [(); { crate::meta_num_slots_default!(A) }]:
{
fn clone_into(&self, target: &mut Vec<T, A>);
}

#[cfg(not(no_global_oom_handling))]
#[allow(unused_braces)]
impl<T: Clone, A: Allocator> SpecCloneIntoVec<T, A> for [T]
where [(); { crate::meta_num_slots!(A, CO_ALLOC_PREF) }]:
where [(); { crate::meta_num_slots_default!(A) }]:
{
default fn clone_into(&self, target: &mut Vec<T, A>) {
// drop anything in target that will not be overwritten
Expand All @@ -1013,7 +1013,7 @@ where [(); { crate::meta_num_slots!(A, CO_ALLOC_PREF) }]:
#[cfg(not(no_global_oom_handling))]
#[allow(unused_braces)]
impl<T: Copy, A: Allocator> SpecCloneIntoVec<T, A> for [T]
where [(); { crate::meta_num_slots!(A, CO_ALLOC_PREF) }]:
where [(); { crate::meta_num_slots_default!(A) }]:
{
fn clone_into(&self, target: &mut Vec<T, A>) {
target.clear();
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/io/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ where
/// Read is implemented for `VecDeque<u8>` by consuming bytes from the front of the `VecDeque`.
#[stable(feature = "vecdeque_read_write", since = "1.63.0")]
#[allow(unused_braces)]
impl<A: Allocator, const _CO_ALLOC_PREF: CoAllocPref> Read for VecDeque<u8, A, _CO_ALLOC_PREF>
impl<A: Allocator, const CO_ALLOC_PREF: CoAllocPref> Read for VecDeque<u8, A, CO_ALLOC_PREF>
where
[(); { meta_num_slots!(A, CO_ALLOC_PREF) }]:,
{
Expand Down Expand Up @@ -448,7 +448,7 @@ where
/// Write is implemented for `VecDeque<u8>` by appending to the `VecDeque`, growing it as needed.
#[stable(feature = "vecdeque_read_write", since = "1.63.0")]
#[allow(unused_braces)]
impl<A: Allocator, const _CO_ALLOC_PREF: CoAllocPref> Write for VecDeque<u8, A, _CO_ALLOC_PREF>
impl<A: Allocator, const CO_ALLOC_PREF: CoAllocPref> Write for VecDeque<u8, A, CO_ALLOC_PREF>
where
[(); { meta_num_slots!(A, CO_ALLOC_PREF) }]:,
{
Expand Down

0 comments on commit b9f350c

Please sign in to comment.