Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing urls in ptr docs #40703

Merged
merged 1 commit into from
Apr 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/libstd/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ mod prim_unit { }
/// Working with raw pointers in Rust is uncommon,
/// typically limited to a few patterns.
///
/// Use the `null` function to create null pointers, and the `is_null` method
/// Use the [`null`] function to create null pointers, and the [`is_null`] method
/// of the `*const T` type to check for null. The `*const T` type also defines
/// the `offset` method, for pointer math.
/// the [`offset`] method, for pointer math.
///
/// # Common ways to create raw pointers
///
Expand Down Expand Up @@ -213,7 +213,7 @@ mod prim_unit { }
///
/// ## 2. Consume a box (`Box<T>`).
///
/// The `into_raw` function consumes a box and returns
/// The [`into_raw`] function consumes a box and returns
/// the raw pointer. It doesn't destroy `T` or deallocate any memory.
///
/// ```
Expand All @@ -227,7 +227,7 @@ mod prim_unit { }
/// }
/// ```
///
/// Note that here the call to `drop` is for clarity - it indicates
/// Note that here the call to [`drop`] is for clarity - it indicates
/// that we are done with the given value and it should be destroyed.
///
/// ## 3. Get it from C.
Expand Down Expand Up @@ -255,6 +255,11 @@ mod prim_unit { }
///
/// *[See also the `std::ptr` module](ptr/index.html).*
///
/// [`null`]: ../std/ptr/fn.null.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why go up and then go back into std again? that is why not

ptr/fn.null.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid falling back on core. I had issues in the past with weird linking like this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you recall what those issues are? I know there are issues regarding linking things from libcollections because things are reexported, but wasn't aware of issues with core or std.

Copy link
Member Author

@GuillaumeGomez GuillaumeGomez Mar 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have too many PRs so I can't find it but it was common when we linked from core to not find the equivalent in core so I used to always target std. Maybe things have changed since then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this change cause issues for people who use no_std?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point!

/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
/// [`offset`]: ../std/primitive.pointer.html#method.offset
/// [`into_raw`]: ../std/boxed/struct.Box.html#method.into_raw
/// [`drop`]: ../std/mem/fn.drop.html
#[stable(feature = "rust1", since = "1.0.0")]
mod prim_pointer { }

Expand Down