Skip to content

Commit 2fd2198

Browse files
CoAlloc: intra-docs links in rustdocs
1 parent be30513 commit 2fd2198

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,12 @@ impl<T, const CO_ALLOC_PREF: CoAllocPref> VecDeque<T, Global, CO_ALLOC_PREF>
28722872
where
28732873
[(); { crate::meta_num_slots_global!(CO_ALLOC_PREF) }]:,
28742874
{
2875-
/// Like [from_iter()], but coallocation-aware.
2875+
/// Like [<VecDeque::<T>>::from_iter()], but coallocation-aware.
2876+
/// Like [VecDeque::<T>::from_iter()], but coallocation-aware.
2877+
/// Like [<VecDeque::<T>>::from_iter(I)], but coallocation-aware.
2878+
/// Like [VecDeque::<T>::from_iter(I)], but coallocation-aware.
2879+
/// Like [<VecDeque::<T>>::from_iter(I: IntoIterator<Item = T>)], but coallocation-aware.
2880+
/// Like [VecDeque::<T>::from_iter(I: IntoIterator<Item = T>)], but coallocation-aware.
28762881
pub fn from_iter_co<I: IntoIterator<Item = T>>(iter: I) -> VecDeque<T, Global, CO_ALLOC_PREF> {
28772882
SpecFromIterCo::spec_from_iter_co(iter.into_iter())
28782883
}

library/alloc/src/macros.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ macro_rules! check_type_and_cast {
154154
}
155155

156156
// ----- CoAlloc constant-like macros:
157-
/// 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]).
157+
/// Coallocation option/parameter about using metadata that does prefer to use meta data. This is of type [crate::co_alloc::CoAllocMetaNumSlotsPref] (but not a whole [crate::co_alloc::CoAllocPref]).
158158
#[doc(hidden)]
159159
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
160160
#[macro_export]
@@ -164,7 +164,7 @@ macro_rules! CO_ALLOC_PREF_NUM_META_SLOTS_ONE {
164164
};
165165
}
166166

167-
/// 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]).
167+
/// Coallocation option/parameter about using metadata that prefers NOT to use meta data. This is of type [crate::co_alloc::CoAllocMetaNumSlotsPref] (but not a whole [crate::co_alloc::CoAllocPref]).
168168
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
169169
#[macro_export]
170170
macro_rules! CO_ALLOC_PREF_NUM_META_SLOTS_ZERO {
@@ -173,7 +173,7 @@ macro_rules! CO_ALLOC_PREF_NUM_META_SLOTS_ZERO {
173173
};
174174
}
175175

176-
/// Default coallocation option/parameter about using metadata (whether to use meta data, or not). This is of type [::alloc::co_alloc::CoAllocMetaNumSlotsPref] (but not a whole []::alloc::co_alloc::CoAllocPref]).
176+
/// Default coallocation option/parameter about using metadata (whether to use meta data, or not). This is of type [crate::co_alloc::CoAllocMetaNumSlotsPref] (but not a whole [crate::co_alloc::CoAllocPref]).
177177
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
178178
#[macro_export]
179179
macro_rules! CO_ALLOC_PREF_NUM_META_SLOTS_DEFAULT {
@@ -237,7 +237,7 @@ macro_rules! CO_ALLOC_PREF_META_DEFAULT {
237237
};
238238
}
239239

240-
/// Default [co_alloc::CoAllocPref] value/config, based on `CO_ALLOC_PREF_META_DEFAULT`.
240+
/// Default [crate::co_alloc::CoAllocPref] value/config, based on `CO_ALLOC_PREF_META_DEFAULT`.
241241
#[unstable(feature = "global_co_alloc_meta", issue = "none")]
242242
#[macro_export]
243243
macro_rules! CO_ALLOC_PREF_DEFAULT {
@@ -291,10 +291,10 @@ macro_rules! co_alloc_pref {
291291
/// cooperative.
292292
///
293293
/// @param `alloc` Allocator (implementation) type. @param `co_alloc_pref` The heap-based type's
294-
/// preference for coallocation, as an [::alloc::CoAllocPref] value.
294+
/// preference for coallocation, as an [crate::co_alloc::CoAllocPref] value.
295295
///
296296
/// The type of second parameter `co_alloc_pref` WILL CHANGE. DO NOT hardcode/cast/mix that type.
297-
/// Instead, use [co_alloc::CoAllocPref].
297+
/// Instead, use [crate::co_alloc::CoAllocPref].
298298
///
299299
// FIXME replace the macro with an (updated version of the below) `const` function). Only once
300300
// generic_const_exprs is stable (that is, when consumer crates don't need to declare

library/alloc/src/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ impl<T> [T] {
644644
hack::into_vec(self)
645645
}
646646

647-
/// Coallocation-aware version of [into_vec()].
647+
/// Coallocation-aware version of [into_vec::<A>()].
648648
#[rustc_allow_incoherent_impl]
649649
#[unstable(feature = "global_co_alloc", issue = "none")]
650650
#[inline]

0 commit comments

Comments
 (0)