Skip to content

Commit 8709c39

Browse files
authored
Rollup merge of #107109 - est31:thin_box_link, r=Mark-Simulacrum
ThinBox: Add intra-doc-links for Metadata
2 parents 1702349 + 4127988 commit 8709c39

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library/alloc/src/boxed/thin.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ unsafe impl<T: ?Sized + Sync> Sync for ThinBox<T> {}
4848

4949
#[unstable(feature = "thin_box", issue = "92791")]
5050
impl<T> ThinBox<T> {
51-
/// Moves a type to the heap with its `Metadata` stored in the heap allocation instead of on
51+
/// Moves a type to the heap with its [`Metadata`] stored in the heap allocation instead of on
5252
/// the stack.
5353
///
5454
/// # Examples
@@ -59,6 +59,8 @@ impl<T> ThinBox<T> {
5959
///
6060
/// let five = ThinBox::new(5);
6161
/// ```
62+
///
63+
/// [`Metadata`]: core::ptr::Pointee::Metadata
6264
#[cfg(not(no_global_oom_handling))]
6365
pub fn new(value: T) -> Self {
6466
let meta = ptr::metadata(&value);
@@ -69,7 +71,7 @@ impl<T> ThinBox<T> {
6971

7072
#[unstable(feature = "thin_box", issue = "92791")]
7173
impl<Dyn: ?Sized> ThinBox<Dyn> {
72-
/// Moves a type to the heap with its `Metadata` stored in the heap allocation instead of on
74+
/// Moves a type to the heap with its [`Metadata`] stored in the heap allocation instead of on
7375
/// the stack.
7476
///
7577
/// # Examples
@@ -80,6 +82,8 @@ impl<Dyn: ?Sized> ThinBox<Dyn> {
8082
///
8183
/// let thin_slice = ThinBox::<[i32]>::new_unsize([1, 2, 3, 4]);
8284
/// ```
85+
///
86+
/// [`Metadata`]: core::ptr::Pointee::Metadata
8387
#[cfg(not(no_global_oom_handling))]
8488
pub fn new_unsize<T>(value: T) -> Self
8589
where

0 commit comments

Comments
 (0)