Skip to content

Commit 677ed48

Browse files
authored
Rollup merge of #50588 - ExpHP:i-can-see-my-house-from-here, r=frewsxcv
Move "See also" disambiguation links for primitive types to top Closes #50384. <details> <summary>Images</summary> ![rust-slice](https://user-images.githubusercontent.com/1411280/39843148-caa41c3e-53b7-11e8-8123-b57c25a4d9e0.png) ![rust-isize](https://user-images.githubusercontent.com/1411280/39843146-ca94b384-53b7-11e8-85f3-3f5e5d353a05.png) </details> r? @steveklabnik
2 parents 10c986e + b8eb91a commit 677ed48

File tree

7 files changed

+23
-25
lines changed

7 files changed

+23
-25
lines changed

src/liballoc/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
//! A dynamically-sized view into a contiguous sequence, `[T]`.
1212
//!
13+
//! *[See also the slice primitive type](../../std/primitive.slice.html).*
14+
//!
1315
//! Slices are a view into a block of memory represented as a pointer and a
1416
//! length.
1517
//!
@@ -78,8 +80,6 @@
7880
//! * Further methods that return iterators are [`.split`], [`.splitn`],
7981
//! [`.chunks`], [`.windows`] and more.
8082
//!
81-
//! *[See also the slice primitive type](../../std/primitive.slice.html).*
82-
//!
8383
//! [`Clone`]: ../../std/clone/trait.Clone.html
8484
//! [`Eq`]: ../../std/cmp/trait.Eq.html
8585
//! [`Ord`]: ../../std/cmp/trait.Ord.html

src/liballoc/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
//! Unicode string slices.
1212
//!
13+
//! *[See also the `str` primitive type](../../std/primitive.str.html).*
14+
//!
1315
//! The `&str` type is one of the two main string types, the other being `String`.
1416
//! Unlike its `String` counterpart, its contents are borrowed.
1517
//!
@@ -29,8 +31,6 @@
2931
//! ```
3032
//! let hello_world: &'static str = "Hello, world!";
3133
//! ```
32-
//!
33-
//! *[See also the `str` primitive type](../../std/primitive.str.html).*
3434
3535
#![stable(feature = "rust1", since = "1.0.0")]
3636

src/libcore/num/f32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! This module provides constants which are specific to the implementation
1212
//! of the `f32` floating point data type.
1313
//!
14-
//! Mathematically significant numbers are provided in the `consts` sub-module.
15-
//!
1614
//! *[See also the `f32` primitive type](../../std/primitive.f32.html).*
15+
//!
16+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1717
1818
#![stable(feature = "rust1", since = "1.0.0")]
1919

src/libcore/num/f64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! This module provides constants which are specific to the implementation
1212
//! of the `f64` floating point data type.
1313
//!
14-
//! Mathematically significant numbers are provided in the `consts` sub-module.
15-
//!
1614
//! *[See also the `f64` primitive type](../../std/primitive.f64.html).*
15+
//!
16+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1717
1818
#![stable(feature = "rust1", since = "1.0.0")]
1919

src/libstd/f32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! This module provides constants which are specific to the implementation
1212
//! of the `f32` floating point data type.
1313
//!
14-
//! Mathematically significant numbers are provided in the `consts` sub-module.
15-
//!
1614
//! *[See also the `f32` primitive type](../../std/primitive.f32.html).*
15+
//!
16+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1717
1818
#![stable(feature = "rust1", since = "1.0.0")]
1919
#![allow(missing_docs)]

src/libstd/f64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
//! This module provides constants which are specific to the implementation
1212
//! of the `f64` floating point data type.
1313
//!
14-
//! Mathematically significant numbers are provided in the `consts` sub-module.
15-
//!
1614
//! *[See also the `f64` primitive type](../../std/primitive.f64.html).*
15+
//!
16+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1717
1818
#![stable(feature = "rust1", since = "1.0.0")]
1919
#![allow(missing_docs)]

src/libstd/primitive_docs.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ mod prim_unit { }
370370
//
371371
/// Raw, unsafe pointers, `*const T`, and `*mut T`.
372372
///
373+
/// *[See also the `std::ptr` module](ptr/index.html).*
374+
///
373375
/// Working with raw pointers in Rust is uncommon,
374376
/// typically limited to a few patterns.
375377
///
@@ -444,8 +446,6 @@ mod prim_unit { }
444446
/// but C APIs hand out a lot of pointers generally, so are a common source
445447
/// of raw pointers in Rust.
446448
///
447-
/// *[See also the `std::ptr` module](ptr/index.html).*
448-
///
449449
/// [`null`]: ../std/ptr/fn.null.html
450450
/// [`null_mut`]: ../std/ptr/fn.null_mut.html
451451
/// [`is_null`]: ../std/primitive.pointer.html#method.is_null
@@ -563,6 +563,8 @@ mod prim_array { }
563563
//
564564
/// A dynamically-sized view into a contiguous sequence, `[T]`.
565565
///
566+
/// *[See also the `std::slice` module](slice/index.html).*
567+
///
566568
/// Slices are a view into a block of memory represented as a pointer and a
567569
/// length.
568570
///
@@ -585,24 +587,20 @@ mod prim_array { }
585587
/// assert_eq!(x, &[1, 7, 3]);
586588
/// ```
587589
///
588-
/// *[See also the `std::slice` module](slice/index.html).*
589-
///
590590
#[stable(feature = "rust1", since = "1.0.0")]
591591
mod prim_slice { }
592592

593593
#[doc(primitive = "str")]
594594
//
595595
/// String slices.
596596
///
597+
/// *[See also the `std::str` module](str/index.html).*
598+
///
597599
/// The `str` type, also called a 'string slice', is the most primitive string
598600
/// type. It is usually seen in its borrowed form, `&str`. It is also the type
599601
/// of string literals, `&'static str`.
600602
///
601-
/// Strings slices are always valid UTF-8.
602-
///
603-
/// This documentation describes a number of methods and trait implementations
604-
/// on the `str` type. For technical reasons, there is additional, separate
605-
/// documentation in the [`std::str`](str/index.html) module as well.
603+
/// String slices are always valid UTF-8.
606604
///
607605
/// # Examples
608606
///
@@ -862,23 +860,23 @@ mod prim_u128 { }
862860
//
863861
/// The pointer-sized signed integer type.
864862
///
863+
/// *[See also the `std::isize` module](isize/index.html).*
864+
///
865865
/// The size of this primitive is how many bytes it takes to reference any
866866
/// location in memory. For example, on a 32 bit target, this is 4 bytes
867867
/// and on a 64 bit target, this is 8 bytes.
868-
///
869-
/// *[See also the `std::isize` module](isize/index.html).*
870868
#[stable(feature = "rust1", since = "1.0.0")]
871869
mod prim_isize { }
872870

873871
#[doc(primitive = "usize")]
874872
//
875873
/// The pointer-sized unsigned integer type.
876874
///
875+
/// *[See also the `std::usize` module](usize/index.html).*
876+
///
877877
/// The size of this primitive is how many bytes it takes to reference any
878878
/// location in memory. For example, on a 32 bit target, this is 4 bytes
879879
/// and on a 64 bit target, this is 8 bytes.
880-
///
881-
/// *[See also the `std::usize` module](usize/index.html).*
882880
#[stable(feature = "rust1", since = "1.0.0")]
883881
mod prim_usize { }
884882

0 commit comments

Comments
 (0)