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

This commit is contained in:
Camelid 2020-10-12 13:42:49 -07:00
parent f3ab6f0584
commit 95221b4eb5
8 changed files with 20 additions and 20 deletions

View File

@ -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]
@ -36,7 +36,7 @@ extern "Rust" {
/// if there is one, or the `std` crates 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;

View File

@ -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> {
@ -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>,
@ -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,
@ -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,

View File

@ -501,9 +501,9 @@ pub fn once_with<A, F: FnOnce() -> A>(gen: F) -> OnceWith<F> {
///
/// # Examples
///
/// Lets re-implement the counter iterator from [module-level documentation]:
/// Lets re-implement the counter iterator from the [module-level documentation]:
///
/// [module-level documentation]: index.html
/// [module-level documentation]: super
///
/// ```
/// let mut count = 0;

View File

@ -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
///
@ -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`].
///
@ -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
///

View File

@ -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 {

View File

@ -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"]

View File

@ -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 {
@ -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

View File

@ -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
///
@ -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
///