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

Improve and clean up some intra-doc links #78757

Merged
merged 3 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ extern "rust-intrinsic" {
/// macro, which panics when it is executed, it is *undefined behavior* to
/// reach code marked with this function.
///
/// The stabilized version of this intrinsic is [`crate::hint::unreachable_unchecked`].
/// The stabilized version of this intrinsic is [`core::hint::unreachable_unchecked`](crate::hint::unreachable_unchecked).
#[rustc_const_unstable(feature = "const_unreachable_unchecked", issue = "53188")]
pub fn unreachable() -> !;

Expand Down Expand Up @@ -764,20 +764,20 @@ extern "rust-intrinsic" {
/// More specifically, this is the offset in bytes between successive
/// items of the same type, including alignment padding.
///
/// The stabilized version of this intrinsic is [`crate::mem::size_of`].
/// The stabilized version of this intrinsic is [`core::mem::size_of`](crate::mem::size_of).
#[rustc_const_stable(feature = "const_size_of", since = "1.40.0")]
pub fn size_of<T>() -> usize;

/// Moves a value to an uninitialized memory location.
///
/// Drop glue is not run on the destination.
///
/// The stabilized version of this intrinsic is [`crate::ptr::write`].
/// The stabilized version of this intrinsic is [`core::ptr::write`](crate::ptr::write).
pub fn move_val_init<T>(dst: *mut T, src: T);

/// The minimum alignment of a type.
///
/// The stabilized version of this intrinsic is [`crate::mem::align_of`].
/// The stabilized version of this intrinsic is [`core::mem::align_of`](crate::mem::align_of).
#[rustc_const_stable(feature = "const_min_align_of", since = "1.40.0")]
pub fn min_align_of<T>() -> usize;
/// The preferred alignment of a type.
Expand All @@ -793,21 +793,21 @@ extern "rust-intrinsic" {
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
/// The required alignment of the referenced value.
///
/// The stabilized version of this intrinsic is [`crate::mem::align_of_val`].
/// The stabilized version of this intrinsic is [`core::mem::align_of_val`](crate::mem::align_of_val).
#[rustc_const_unstable(feature = "const_align_of_val", issue = "46571")]
pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;

/// Gets a static string slice containing the name of a type.
///
/// The stabilized version of this intrinsic is [`crate::any::type_name`].
/// The stabilized version of this intrinsic is [`core::any::type_name`](crate::any::type_name).
#[rustc_const_unstable(feature = "const_type_name", issue = "63084")]
pub fn type_name<T: ?Sized>() -> &'static str;

/// Gets an identifier which is globally unique to the specified type. This
/// function will return the same value for a type regardless of whichever
/// crate it is invoked in.
///
/// The stabilized version of this intrinsic is [`crate::any::TypeId::of`].
/// The stabilized version of this intrinsic is [`core::any::TypeId::of`](crate::any::TypeId::of).
#[rustc_const_unstable(feature = "const_type_id", issue = "77125")]
pub fn type_id<T: ?Sized + 'static>() -> u64;

Expand All @@ -831,7 +831,7 @@ extern "rust-intrinsic" {

/// Gets a reference to a static `Location` indicating where it was called.
///
/// Consider using [`crate::panic::Location::caller`] instead.
/// Consider using [`core::panic::Location::caller`](crate::panic::Location::caller) instead.
#[rustc_const_unstable(feature = "const_caller_location", issue = "76156")]
pub fn caller_location() -> &'static crate::panic::Location<'static>;

Expand Down Expand Up @@ -1152,11 +1152,11 @@ extern "rust-intrinsic" {

/// Performs a volatile load from the `src` pointer.
///
/// The stabilized version of this intrinsic is [`crate::ptr::read_volatile`].
/// The stabilized version of this intrinsic is [`core::ptr::read_volatile`](crate::ptr::read_volatile).
pub fn volatile_load<T>(src: *const T) -> T;
/// Performs a volatile store to the `dst` pointer.
///
/// The stabilized version of this intrinsic is [`crate::ptr::write_volatile`].
/// The stabilized version of this intrinsic is [`core::ptr::write_volatile`](crate::ptr::write_volatile).
pub fn volatile_store<T>(dst: *mut T, val: T);

/// Performs a volatile load from the `src` pointer
Expand Down Expand Up @@ -1697,7 +1697,7 @@ extern "rust-intrinsic" {
/// Returns the value of the discriminant for the variant in 'v',
/// cast to a `u64`; if `T` has no discriminant, returns 0.
///
/// The stabilized version of this intrinsic is [`crate::mem::discriminant`].
/// The stabilized version of this intrinsic is [`core::mem::discriminant`](crate::mem::discriminant).
#[rustc_const_unstable(feature = "const_discriminant", issue = "69821")]
pub fn discriminant_value<T>(v: &T) -> <T as DiscriminantKind>::Discriminant;

Expand Down
12 changes: 6 additions & 6 deletions library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ mod prim_unit {}
//
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
///
/// *[See also the `std::ptr` module][`ptr`].*
/// *[See also the `std::ptr` module](ptr).*
///
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
Expand Down Expand Up @@ -580,7 +580,7 @@ mod prim_array {}
/// means that elements are laid out so that every element is the same
/// distance from its neighbors.
///
/// *[See also the `std::slice` module][`crate::slice`].*
/// *[See also the `std::slice` module](crate::slice).*
///
/// Slices are a view into a block of memory represented as a pointer and a
/// length.
Expand Down Expand Up @@ -625,7 +625,7 @@ mod prim_slice {}
//
/// String slices.
///
/// *[See also the `std::str` module][`crate::str`].*
/// *[See also the `std::str` module](crate::str).*
///
/// The `str` type, also called a 'string slice', is the most primitive string
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
Expand Down Expand Up @@ -800,7 +800,7 @@ mod prim_tuple {}
/// calculation with floats round to a nearby representable number. For example,
/// `5.0` and `1.0` can be exactly represented as `f32`, but `1.0 / 5.0` results
/// in `0.20000000298023223876953125` since `0.2` cannot be exactly represented
/// as `f32`. Note however, that printing floats with `println` and friends will
/// as `f32`. Note, however, that printing floats with `println` and friends will
/// often discard insignificant digits: `println!("{}", 1.0f32 / 5.0f32)` will
/// print `0.2`.
///
Expand All @@ -820,7 +820,7 @@ mod prim_tuple {}
///
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
///
/// *[See also the `std::f32::consts` module][`crate::f32::consts`].*
/// *[See also the `std::f32::consts` module](crate::f32::consts).*
///
/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -834,7 +834,7 @@ mod prim_f32 {}
/// `f32`][`f32`] or [Wikipedia on double precision
/// values][wikipedia] for more information.
///
/// *[See also the `std::f64::consts` module][`crate::f64::consts`].*
/// *[See also the `std::f64::consts` module](crate::f64::consts).*
///
/// [`f32`]: prim@f32
/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format
Expand Down