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

Use intra-doc links for links to module-level docs #77870

Merged
merged 1 commit into from
Oct 14, 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
6 changes: 3 additions & 3 deletions library/alloc/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ mod tests;

extern "Rust" {
// These are the magic symbols to call the global allocator. rustc generates
// them to call `__rg_alloc` etc if there is a `#[global_allocator]` attribute
// them to call `__rg_alloc` etc. if there is a `#[global_allocator]` attribute
// (the code expanding that attribute macro generates those functions), or to call
// the default implementations in libstd (`__rdl_alloc` etc in `src/libstd/alloc.rs`)
// the default implementations in libstd (`__rdl_alloc` etc. in `library/std/src/alloc.rs`)
// otherwise.
#[rustc_allocator]
#[rustc_allocator_nounwind]
Expand All @@ -36,7 +36,7 @@ extern "Rust" {
/// if there is one, or the `std` crate’s default.
///
/// Note: while this type is unstable, the functionality it provides can be
/// accessed through the [free functions in `alloc`](index.html#functions).
/// accessed through the [free functions in `alloc`](self#functions).
#[unstable(feature = "allocator_api", issue = "32838")]
#[derive(Copy, Clone, Default, Debug)]
pub struct Global;
Expand Down
8 changes: 4 additions & 4 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ use crate::ptr;
/// assert_eq!(my_struct.special_field.get(), new_value);
/// ```
///
/// See the [module-level documentation](index.html) for more.
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
#[repr(transparent)]
pub struct Cell<T: ?Sized> {
Expand Down Expand Up @@ -566,7 +566,7 @@ impl<T> Cell<[T]> {

/// A mutable memory location with dynamically checked borrow rules
///
/// See the [module-level documentation](index.html) for more.
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
pub struct RefCell<T: ?Sized> {
borrow: Cell<BorrowFlag>,
Expand Down Expand Up @@ -1203,7 +1203,7 @@ impl Clone for BorrowRef<'_> {
/// Wraps a borrowed reference to a value in a `RefCell` box.
/// A wrapper type for an immutably borrowed value from a `RefCell<T>`.
///
/// See the [module-level documentation](index.html) for more.
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Ref<'b, T: ?Sized + 'b> {
value: &'b T,
Expand Down Expand Up @@ -1493,7 +1493,7 @@ impl<'b> BorrowRefMut<'b> {

/// A wrapper type for a mutably borrowed value from a `RefCell<T>`.
///
/// See the [module-level documentation](index.html) for more.
/// See the [module-level documentation](self) for more.
#[stable(feature = "rust1", since = "1.0.0")]
pub struct RefMut<'b, T: ?Sized + 'b> {
value: &'b mut T,
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/iter/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> {
///
/// # Examples
///
/// Let’s re-implement the counter iterator from [module-level documentation]:
/// Let’s re-implement the counter iterator from the [module-level documentation]:
///
/// [module-level documentation]: index.html
/// [module-level documentation]: super
camelid marked this conversation as resolved.
Show resolved Hide resolved
///
/// ```
/// let mut count = 0;
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/iter/traits/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub trait FromIterator<A>: Sized {
///
/// See the [module-level documentation] for more.
///
/// [module-level documentation]: index.html
/// [module-level documentation]: crate::iter
///
/// # Examples
///
Expand All @@ -120,7 +120,7 @@ pub trait FromIterator<A>: Sized {
/// collection of some kind.
///
/// One benefit of implementing `IntoIterator` is that your type will [work
/// with Rust's `for` loop syntax](index.html#for-loops-and-intoiterator).
/// with Rust's `for` loop syntax](crate::iter#for-loops-and-intoiterator).
///
/// See also: [`FromIterator`].
///
Expand Down Expand Up @@ -212,7 +212,7 @@ pub trait IntoIterator {
///
/// See the [module-level documentation] for more.
///
/// [module-level documentation]: index.html
/// [module-level documentation]: crate::iter
///
/// # Examples
///
Expand Down
6 changes: 3 additions & 3 deletions library/core/src/iter/traits/exact_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
/// assert_eq!(5, five.len());
/// ```
///
/// In the [module level docs][moddocs], we implemented an [`Iterator`],
/// `Counter`. Let's implement `ExactSizeIterator` for it as well:
/// In the [module-level docs], we implemented an [`Iterator`], `Counter`.
/// Let's implement `ExactSizeIterator` for it as well:
///
/// [moddocs]: index.html
/// [module-level docs]: crate::iter
///
/// ```
/// # struct Counter {
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ use crate::{convert, fmt};

/// `Result` is a type that represents either success ([`Ok`]) or failure ([`Err`]).
///
/// See the [`std::result`](index.html) module documentation for details.
/// See the [module documentation](self) for details.
#[derive(Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
#[must_use = "this `Result` may be an `Err` variant, which should be handled"]
#[rustc_diagnostic_item = "result_type"]
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
/// [`&OsStr`]: OsStr
/// [`&str`]: str
/// [`CStr`]: crate::ffi::CStr
/// [conversions]: index.html#conversions
/// [conversions]: super#conversions
#[derive(Clone)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct OsString {
Expand All @@ -88,7 +88,7 @@ pub struct OsString {
/// the traits which `OsStr` implements for [conversions] from/to native representations.
///
/// [`&str`]: str
/// [conversions]: index.html#conversions
/// [conversions]: super#conversions
#[stable(feature = "rust1", since = "1.0.0")]
// FIXME:
// `OsStr::from_inner` current implementation relies
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ impl FusedIterator for Ancestors<'_> {}
/// [`set_extension`]: PathBuf::set_extension
///
/// More details about the overall approach can be found in
/// the [module documentation](index.html).
/// the [module documentation](self).
///
/// # Examples
///
Expand Down Expand Up @@ -1655,7 +1655,7 @@ impl AsRef<OsStr> for PathBuf {
/// see [`PathBuf`].
///
/// More details about the overall approach can be found in
/// the [module documentation](index.html).
/// the [module documentation](self).
///
/// # Examples
///
Expand Down