Skip to content

Commit

Permalink
Rollup merge of #78757 - camelid:crate-link-text, r=jyn514
Browse files Browse the repository at this point in the history
Improve and clean up some intra-doc links
  • Loading branch information
m-ou-se committed Nov 5, 2020
2 parents 679c4c7 + 677b2ac commit f383e4f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
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 @@ -577,7 +577,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 @@ -622,7 +622,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 @@ -797,7 +797,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 @@ -817,7 +817,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 @@ -831,7 +831,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

0 comments on commit f383e4f

Please sign in to comment.