Skip to content

Commit f383e4f

Browse files
authoredNov 5, 2020
Rollup merge of #78757 - camelid:crate-link-text, r=jyn514
Improve and clean up some intra-doc links
2 parents 679c4c7 + 677b2ac commit f383e4f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed
 

‎library/core/src/intrinsics.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ extern "rust-intrinsic" {
719719
/// macro, which panics when it is executed, it is *undefined behavior* to
720720
/// reach code marked with this function.
721721
///
722-
/// The stabilized version of this intrinsic is [`crate::hint::unreachable_unchecked`].
722+
/// The stabilized version of this intrinsic is [`core::hint::unreachable_unchecked`](crate::hint::unreachable_unchecked).
723723
#[rustc_const_unstable(feature = "const_unreachable_unchecked", issue = "53188")]
724724
pub fn unreachable() -> !;
725725

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

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

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

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

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

@@ -831,7 +831,7 @@ extern "rust-intrinsic" {
831831

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

@@ -1152,11 +1152,11 @@ extern "rust-intrinsic" {
11521152

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

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

‎library/std/src/primitive_docs.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ mod prim_unit {}
389389
//
390390
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
391391
///
392-
/// *[See also the `std::ptr` module][`ptr`].*
392+
/// *[See also the `std::ptr` module](ptr).*
393393
///
394394
/// Working with raw pointers in Rust is uncommon, typically limited to a few patterns.
395395
/// Raw pointers can be unaligned or [`null`]. However, when a raw pointer is
@@ -577,7 +577,7 @@ mod prim_array {}
577577
/// means that elements are laid out so that every element is the same
578578
/// distance from its neighbors.
579579
///
580-
/// *[See also the `std::slice` module][`crate::slice`].*
580+
/// *[See also the `std::slice` module](crate::slice).*
581581
///
582582
/// Slices are a view into a block of memory represented as a pointer and a
583583
/// length.
@@ -622,7 +622,7 @@ mod prim_slice {}
622622
//
623623
/// String slices.
624624
///
625-
/// *[See also the `std::str` module][`crate::str`].*
625+
/// *[See also the `std::str` module](crate::str).*
626626
///
627627
/// The `str` type, also called a 'string slice', is the most primitive string
628628
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
@@ -797,7 +797,7 @@ mod prim_tuple {}
797797
/// calculation with floats round to a nearby representable number. For example,
798798
/// `5.0` and `1.0` can be exactly represented as `f32`, but `1.0 / 5.0` results
799799
/// in `0.20000000298023223876953125` since `0.2` cannot be exactly represented
800-
/// as `f32`. Note however, that printing floats with `println` and friends will
800+
/// as `f32`. Note, however, that printing floats with `println` and friends will
801801
/// often discard insignificant digits: `println!("{}", 1.0f32 / 5.0f32)` will
802802
/// print `0.2`.
803803
///
@@ -817,7 +817,7 @@ mod prim_tuple {}
817817
///
818818
/// For more information on floating point numbers, see [Wikipedia][wikipedia].
819819
///
820-
/// *[See also the `std::f32::consts` module][`crate::f32::consts`].*
820+
/// *[See also the `std::f32::consts` module](crate::f32::consts).*
821821
///
822822
/// [wikipedia]: https://en.wikipedia.org/wiki/Single-precision_floating-point_format
823823
#[stable(feature = "rust1", since = "1.0.0")]
@@ -831,7 +831,7 @@ mod prim_f32 {}
831831
/// `f32`][`f32`] or [Wikipedia on double precision
832832
/// values][wikipedia] for more information.
833833
///
834-
/// *[See also the `std::f64::consts` module][`crate::f64::consts`].*
834+
/// *[See also the `std::f64::consts` module](crate::f64::consts).*
835835
///
836836
/// [`f32`]: prim@f32
837837
/// [wikipedia]: https://en.wikipedia.org/wiki/Double-precision_floating-point_format

0 commit comments

Comments
 (0)
Please sign in to comment.