Skip to content

Commit

Permalink
CoAlloc: Tidy for rust-lang/rust rust-lang#109190, rust-lang/rust rus…
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lyons-kehl committed Mar 22, 2023
1 parent 2e99282 commit be30513
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions library/alloc/src/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ const KV_IDX_CENTER: usize = B - 1;
const EDGE_IDX_LEFT_OF_CENTER: usize = B - 1;
const EDGE_IDX_RIGHT_OF_CENTER: usize = B;

/// Workaround https://github.com/rust-lang/rust/issues/108751
/// Workaround <https://github.com/rust-lang/rust/issues/108751>
macro_rules! leaf_node_capacity {
() => {
11
}; // instead of: CAPACITY
}

/// Workaround https://github.com/rust-lang/rust/issues/108751
/// Workaround <https://github.com/rust-lang/rust/issues/108751>
macro_rules! internal_node_capacity {
() => {
12
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/collections/vec_deque/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2872,7 +2872,7 @@ impl<T, const CO_ALLOC_PREF: CoAllocPref> VecDeque<T, Global, CO_ALLOC_PREF>
where
[(); { crate::meta_num_slots_global!(CO_ALLOC_PREF) }]:,
{
/// Like [from_iter], but coallocation-aware.
/// Like [from_iter()], but coallocation-aware.
pub fn from_iter_co<I: IntoIterator<Item = T>>(iter: I) -> VecDeque<T, Global, CO_ALLOC_PREF> {
SpecFromIterCo::spec_from_iter_co(iter.into_iter())
}
Expand Down
8 changes: 4 additions & 4 deletions library/alloc/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ macro_rules! check_type_and_cast {
}

// ----- CoAlloc constant-like macros:
/// Coallocation option/parameter about using metadata that does prefer to use meta data. This is of type [::alloc::co_alloc::CoAllocMetaNumSlotsPref] (but not a whole []::alloc::co_alloc::CoAllocPref]).
/// Coallocation option/parameter about using metadata that does prefer to use meta data. This is of type [co_alloc::CoAllocMetaNumSlotsPref] (but not a whole [co_alloc::CoAllocPref]).
#[doc(hidden)]
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
#[macro_export]
Expand All @@ -164,7 +164,7 @@ macro_rules! CO_ALLOC_PREF_NUM_META_SLOTS_ONE {
};
}

/// Coallocation option/parameter about using metadata that prefers NOT to use meta data. This is of type [::alloc::co_alloc::CoAllocMetaNumSlotsPref] (but not a whole []::alloc::co_alloc::CoAllocPref]).
/// Coallocation option/parameter about using metadata that prefers NOT to use meta data. This is of type [co_alloc::CoAllocMetaNumSlotsPref] (but not a whole [co_alloc::CoAllocPref]).
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
#[macro_export]
macro_rules! CO_ALLOC_PREF_NUM_META_SLOTS_ZERO {
Expand Down Expand Up @@ -237,7 +237,7 @@ macro_rules! CO_ALLOC_PREF_META_DEFAULT {
};
}

/// Default [::alloc::CoAllocPref] value/config, based on `CO_ALLOC_PREF_META_DEFAULT`.
/// Default [co_alloc::CoAllocPref] value/config, based on `CO_ALLOC_PREF_META_DEFAULT`.
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
#[macro_export]
macro_rules! CO_ALLOC_PREF_DEFAULT {
Expand Down Expand Up @@ -294,7 +294,7 @@ macro_rules! co_alloc_pref {
/// preference for coallocation, as an [::alloc::CoAllocPref] value.
///
/// The type of second parameter `co_alloc_pref` WILL CHANGE. DO NOT hardcode/cast/mix that type.
/// Instead, use [::alloc::CoAllocPref].
/// Instead, use [co_alloc::CoAllocPref].
///
// FIXME replace the macro with an (updated version of the below) `const` function). Only once
// generic_const_exprs is stable (that is, when consumer crates don't need to declare
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ impl<T> [T] {
hack::into_vec(self)
}

/// Coallocation-aware version of [into_vec].
/// Coallocation-aware version of [into_vec()].
#[rustc_allow_incoherent_impl]
#[unstable(feature = "global_co_alloc", issue = "none")]
#[inline]
Expand Down

0 comments on commit be30513

Please sign in to comment.