提交 8258cf28 编写于 作者: C Camelid

Convert a bunch of intra-doc links

上级 b2d115f6
......@@ -309,13 +309,13 @@
//! * `?` ⇒ [`Debug`]
//! * `x?` ⇒ [`Debug`] with lower-case hexadecimal integers
//! * `X?` ⇒ [`Debug`] with upper-case hexadecimal integers
//! * `o` ⇒ [`Octal`](trait.Octal.html)
//! * `x` ⇒ [`LowerHex`](trait.LowerHex.html)
//! * `X` ⇒ [`UpperHex`](trait.UpperHex.html)
//! * `p` ⇒ [`Pointer`](trait.Pointer.html)
//! * `o` ⇒ [`Octal`]
//! * `x` ⇒ [`LowerHex`]
//! * `X` ⇒ [`UpperHex`]
//! * `p` ⇒ [`Pointer`]
//! * `b` ⇒ [`Binary`]
//! * `e` ⇒ [`LowerExp`](trait.LowerExp.html)
//! * `E` ⇒ [`UpperExp`](trait.UpperExp.html)
//! * `e` ⇒ [`LowerExp`]
//! * `E` ⇒ [`UpperExp`]
//!
//! What this means is that any type of argument which implements the
//! [`fmt::Binary`][`Binary`] trait can then be formatted with `{:b}`. Implementations
......
......@@ -573,7 +573,7 @@ pub struct RefCell<T: ?Sized> {
value: UnsafeCell<T>,
}
/// An error returned by [`RefCell::try_borrow`](struct.RefCell.html#method.try_borrow).
/// An error returned by [`RefCell::try_borrow`].
#[stable(feature = "try_borrow", since = "1.13.0")]
pub struct BorrowError {
_private: (),
......@@ -593,7 +593,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
}
/// An error returned by [`RefCell::try_borrow_mut`](struct.RefCell.html#method.try_borrow_mut).
/// An error returned by [`RefCell::try_borrow_mut`].
#[stable(feature = "try_borrow", since = "1.13.0")]
pub struct BorrowMutError {
_private: (),
......
......@@ -29,7 +29,7 @@
///
/// This trait allows for partial equality, for types that do not have a full
/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
/// so floating point types implement `PartialEq` but not [`Eq`](Eq).
/// so floating point types implement `PartialEq` but not [`Eq`].
///
/// Formally, the equality must be (for all `a`, `b` and `c`):
///
......
use crate::fmt;
#![allow(unused_imports)]
use crate::fmt::{self, Debug, Formatter};
struct PadAdapter<'buf, 'state> {
buf: &'buf mut (dyn fmt::Write + 'buf),
......@@ -53,14 +55,12 @@ fn write_str(&mut self, mut s: &str) -> fmt::Result {
}
}
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
/// A struct to help with [`fmt::Debug`](Debug) implementations.
///
/// This is useful when you wish to output a formatted struct as a part of your
/// [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
/// [`Debug::fmt`] implementation.
///
/// This can be constructed by the
/// [`Formatter::debug_struct`](struct.Formatter.html#method.debug_struct)
/// method.
/// This can be constructed by the [`Formatter::debug_struct`] method.
///
/// # Examples
///
......@@ -257,14 +257,12 @@ fn is_pretty(&self) -> bool {
}
}
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
/// A struct to help with [`fmt::Debug`](Debug) implementations.
///
/// This is useful when you wish to output a formatted tuple as a part of your
/// [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
/// [`Debug::fmt`] implementation.
///
/// This can be constructed by the
/// [`Formatter::debug_tuple`](struct.Formatter.html#method.debug_tuple)
/// method.
/// This can be constructed by the [`Formatter::debug_tuple`] method.
///
/// # Examples
///
......@@ -428,14 +426,12 @@ fn is_pretty(&self) -> bool {
}
}
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
/// A struct to help with [`fmt::Debug`](Debug) implementations.
///
/// This is useful when you wish to output a formatted set of items as a part
/// of your [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
/// of your [`Debug::fmt`] implementation.
///
/// This can be constructed by the
/// [`Formatter::debug_set`](struct.Formatter.html#method.debug_set)
/// method.
/// This can be constructed by the [`Formatter::debug_set`] method.
///
/// # Examples
///
......@@ -560,14 +556,12 @@ pub fn finish(&mut self) -> fmt::Result {
}
}
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
/// A struct to help with [`fmt::Debug`](Debug) implementations.
///
/// This is useful when you wish to output a formatted list of items as a part
/// of your [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
/// of your [`Debug::fmt`] implementation.
///
/// This can be constructed by the
/// [`Formatter::debug_list`](struct.Formatter.html#method.debug_list)
/// method.
/// This can be constructed by the [`Formatter::debug_list`] method.
///
/// # Examples
///
......@@ -692,14 +686,12 @@ pub fn finish(&mut self) -> fmt::Result {
}
}
/// A struct to help with [`fmt::Debug`](trait.Debug.html) implementations.
/// A struct to help with [`fmt::Debug`](Debug) implementations.
///
/// This is useful when you wish to output a formatted map as a part of your
/// [`Debug::fmt`](trait.Debug.html#tymethod.fmt) implementation.
/// [`Debug::fmt`] implementation.
///
/// This can be constructed by the
/// [`Formatter::debug_map`](struct.Formatter.html#method.debug_map)
/// method.
/// This can be constructed by the [`Formatter::debug_map`] method.
///
/// # Examples
///
......
......@@ -121,7 +121,7 @@ impl<I, U, F> FusedIterator for FlatMap<I, U, F>
/// This `struct` is created by the [`flatten`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`flatten`]: trait.Iterator.html#method.flatten
/// [`flatten`]: Iterator::flatten
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "iterator_flatten", since = "1.29.0")]
......
......@@ -85,7 +85,7 @@ pub unsafe trait SourceIter {
/// * whatever remains in the source after iteration has stopped
/// * the memory that has become unused by advancing a consuming iterator
///
/// [`next()`]: trait.Iterator.html#method.next
/// [`next()`]: Iterator::next
unsafe fn as_inner(&mut self) -> &mut Self::Source;
}
......@@ -94,7 +94,7 @@ pub unsafe trait SourceIter {
/// This `struct` is created by the [`rev`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`rev`]: trait.Iterator.html#method.rev
/// [`rev`]: Iterator::rev
/// [`Iterator`]: trait.Iterator.html
#[derive(Clone, Debug)]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -228,7 +228,7 @@ unsafe impl<I> TrustedLen for Rev<I> where I: TrustedLen + DoubleEndedIterator {
/// This `struct` is created by the [`copied`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`copied`]: trait.Iterator.html#method.copied
/// [`copied`]: Iterator::copied
/// [`Iterator`]: trait.Iterator.html
#[stable(feature = "iter_copied", since = "1.36.0")]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -380,7 +380,7 @@ unsafe impl<'a, I, T: 'a> TrustedLen for Copied<I>
/// This `struct` is created by the [`cloned`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`cloned`]: trait.Iterator.html#method.cloned
/// [`cloned`]: Iterator::cloned
/// [`Iterator`]: trait.Iterator.html
#[stable(feature = "iter_cloned", since = "1.1.0")]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -515,7 +515,7 @@ unsafe impl<'a, I, T: 'a> TrustedLen for Cloned<I>
/// This `struct` is created by the [`cycle`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`cycle`]: trait.Iterator.html#method.cycle
/// [`cycle`]: Iterator::cycle
/// [`Iterator`]: trait.Iterator.html
#[derive(Clone, Debug)]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -600,7 +600,7 @@ impl<I> FusedIterator for Cycle<I> where I: Clone + Iterator {}
/// This `struct` is created by the [`step_by`] method on [`Iterator`]. See
/// its documentation for more.
///
/// [`step_by`]: trait.Iterator.html#method.step_by
/// [`step_by`]: Iterator::step_by
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "iterator_step_by", since = "1.28.0")]
......@@ -833,7 +833,7 @@ impl<I> ExactSizeIterator for StepBy<I> where I: ExactSizeIterator {}
/// This `struct` is created by the [`map`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`map`]: trait.Iterator.html#method.map
/// [`map`]: Iterator::map
/// [`Iterator`]: trait.Iterator.html
///
/// # Notes about side effects
......@@ -1042,7 +1042,7 @@ unsafe impl<B, I: InPlaceIterable, F> InPlaceIterable for Map<I, F> where F: FnM
/// This `struct` is created by the [`filter`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`filter`]: trait.Iterator.html#method.filter
/// [`filter`]: Iterator::filter
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
......@@ -1191,7 +1191,7 @@ unsafe impl<I: InPlaceIterable, P> InPlaceIterable for Filter<I, P> where P: FnM
/// This `struct` is created by the [`filter_map`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`filter_map`]: trait.Iterator.html#method.filter_map
/// [`filter_map`]: Iterator::filter_map
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
......@@ -1338,7 +1338,7 @@ unsafe impl<B, I: InPlaceIterable, F> InPlaceIterable for FilterMap<I, F> where
/// This `struct` is created by the [`enumerate`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`enumerate`]: trait.Iterator.html#method.enumerate
/// [`enumerate`]: Iterator::enumerate
/// [`Iterator`]: trait.Iterator.html
#[derive(Clone, Debug)]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -1574,7 +1574,7 @@ unsafe impl<I: InPlaceIterable> InPlaceIterable for Enumerate<I> {}
/// This `struct` is created by the [`peekable`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`peekable`]: trait.Iterator.html#method.peekable
/// [`peekable`]: Iterator::peekable
/// [`Iterator`]: trait.Iterator.html
#[derive(Clone, Debug)]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -1743,7 +1743,7 @@ impl<I: Iterator> Peekable<I> {
/// Like [`next`], if there is a value, it is wrapped in a `Some(T)`.
/// But if the iteration is over, `None` is returned.
///
/// [`next`]: trait.Iterator.html#tymethod.next
/// [`next`]: Iterator::next
///
/// Because `peek()` returns a reference, and many iterators iterate over
/// references, there can be a possibly confusing situation where the
......@@ -1871,7 +1871,7 @@ unsafe impl<I: InPlaceIterable> InPlaceIterable for Peekable<I> {}
/// This `struct` is created by the [`skip_while`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`skip_while`]: trait.Iterator.html#method.skip_while
/// [`skip_while`]: Iterator::skip_while
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
......@@ -1993,7 +1993,7 @@ unsafe impl<I: InPlaceIterable, F> InPlaceIterable for SkipWhile<I, F> where
/// This `struct` is created by the [`take_while`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`take_while`]: trait.Iterator.html#method.take_while
/// [`take_while`]: Iterator::take_while
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
......@@ -2128,7 +2128,7 @@ unsafe impl<I: InPlaceIterable, F> InPlaceIterable for TakeWhile<I, F> where
/// This `struct` is created by the [`map_while`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`map_while`]: trait.Iterator.html#method.map_while
/// [`map_while`]: Iterator::map_while
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[unstable(feature = "iter_map_while", reason = "recently added", issue = "68537")]
......@@ -2226,7 +2226,7 @@ unsafe impl<B, I: InPlaceIterable, P> InPlaceIterable for MapWhile<I, P> where
/// This `struct` is created by the [`skip`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`skip`]: trait.Iterator.html#method.skip
/// [`skip`]: Iterator::skip
/// [`Iterator`]: trait.Iterator.html
#[derive(Clone, Debug)]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -2422,7 +2422,7 @@ unsafe impl<I: InPlaceIterable> InPlaceIterable for Skip<I> {}
/// This `struct` is created by the [`take`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`take`]: trait.Iterator.html#method.take
/// [`take`]: Iterator::take
/// [`Iterator`]: trait.Iterator.html
#[derive(Clone, Debug)]
#[must_use = "iterators are lazy and do nothing unless consumed"]
......@@ -2627,7 +2627,7 @@ unsafe impl<I: TrustedLen> TrustedLen for Take<I> {}
/// This `struct` is created by the [`scan`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`scan`]: trait.Iterator.html#method.scan
/// [`scan`]: Iterator::scan
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
......@@ -2735,7 +2735,7 @@ unsafe impl<St, F, B, I: InPlaceIterable> InPlaceIterable for Scan<I, St, F> whe
/// This `struct` is created by the [`inspect`] method on [`Iterator`]. See its
/// documentation for more.
///
/// [`inspect`]: trait.Iterator.html#method.inspect
/// [`inspect`]: Iterator::inspect
/// [`Iterator`]: trait.Iterator.html
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "rust1", since = "1.0.0")]
......
......@@ -1390,8 +1390,6 @@ pub struct IntoValues<K, V> {
/// A builder for computing where in a HashMap a key-value pair would be stored.
///
/// See the [`HashMap::raw_entry_mut`] docs for usage examples.
///
/// [`HashMap::raw_entry_mut`]: HashMap::raw_entry_mut
#[unstable(feature = "hash_raw_entry", issue = "56167")]
pub struct RawEntryBuilderMut<'a, K: 'a, V: 'a, S: 'a> {
map: &'a mut HashMap<K, V, S>,
......@@ -1430,8 +1428,6 @@ pub struct RawVacantEntryMut<'a, K: 'a, V: 'a, S: 'a> {
/// A builder for computing where in a HashMap a key-value pair would be stored.
///
/// See the [`HashMap::raw_entry`] docs for usage examples.
///
/// [`HashMap::raw_entry`]: HashMap::raw_entry
#[unstable(feature = "hash_raw_entry", issue = "56167")]
pub struct RawEntryBuilder<'a, K: 'a, V: 'a, S: 'a> {
map: &'a HashMap<K, V, S>,
......
......@@ -535,9 +535,6 @@ unsafe impl<T: Send> Send for SyncSender<T> {}
/// A **send** operation can only fail if the receiving end of a channel is
/// disconnected, implying that the data could never be received. The error
/// contains the data being sent as a payload so it can be recovered.
///
/// [`Sender::send`]: Sender::send
/// [`SyncSender::send`]: SyncSender::send
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(PartialEq, Eq, Clone, Copy)]
pub struct SendError<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);
......
......@@ -143,7 +143,7 @@ pub enum advice {
WILLNEED = 6,
}
/// Enumeration describing the kind of value stored in [`auxv`](struct.auxv.html).
/// Enumeration describing the kind of value stored in [`auxv`].
#[repr(u32)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[non_exhaustive]
......@@ -246,7 +246,7 @@ pub enum clockid {
pub const CONDVAR_HAS_NO_WAITERS: condvar = condvar(0);
/// Identifier for a device containing a file system. Can be used
/// in combination with [`inode`](struct.inode.html) to uniquely identify a file on the
/// in combination with [`inode`] to uniquely identify a file on the
/// local system.
#[repr(C)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
......@@ -808,7 +808,7 @@ pub struct rights: u64 {
const FILE_SYMLINK = 0x0000000001000000;
/// The right to invoke [`file_unlink()`](fn.file_unlink.html).
const FILE_UNLINK = 0x0000000002000000;
/// The right to invoke [`mem_map()`](fn.mem_map.html) with [`mprot`](struct.mprot.html) set to
/// The right to invoke [`mem_map()`](fn.mem_map.html) with [`mprot`] set to
/// zero.
const MEM_MAP = 0x0000000004000000;
/// If [`MEM_MAP`](struct.rights.html#associatedconstant.MEM_MAP) is set, the right to invoke
......@@ -1020,7 +1020,7 @@ pub struct subrwflags: u16 {
/// written it into locks when acquiring them for writing. It is
/// not advised to use these identifiers for any other purpose.
///
/// As the thread identifier is also stored in [`lock`](struct.lock.html) when
/// As the thread identifier is also stored in [`lock`] when
/// [`LOCK_WRLOCKED`](constant.LOCK_WRLOCKED.html) is set, the top two bits of the thread
/// must always be set to zero.
#[repr(C)]
......@@ -1373,7 +1373,7 @@ fn lookup_layout_test() {
/// Entry point for a process (`_start`).
///
/// **auxv**:
/// The auxiliary vector. See [`auxv`](struct.auxv.html).
/// The auxiliary vector. See [`auxv`].
pub type processentry = unsafe extern "C" fn(auxv: *const auxv) -> ();
/// Arguments of [`sock_recv()`](fn.sock_recv.html).
......@@ -2372,7 +2372,7 @@ pub unsafe fn file_open(
///
/// When successful, the contents of the output buffer consist of
/// a sequence of directory entries. Each directory entry consists
/// of a [`dirent`](struct.dirent.html) object, followed by [`dirent.d_namlen`](struct.dirent.html#structfield.d_namlen) bytes
/// of a [`dirent`] object, followed by [`dirent.d_namlen`](struct.dirent.html#structfield.d_namlen) bytes
/// holding the name of the directory entry.
///
/// This system call fills the output buffer as much as possible,
......
//! SGX-specific extensions to general I/O primitives
//!
//! SGX file descriptors behave differently from Unix file descriptors. See the
//! description of [`TryIntoRawFd`](trait.TryIntoRawFd.html) for more details.
//! description of [`TryIntoRawFd`] for more details.
#![unstable(feature = "sgx_platform", issue = "56975")]
use crate::net;
......
......@@ -255,7 +255,7 @@ pub fn with<F, R>(&'static self, f: F) -> R
///
/// This will lazily initialize the value if this thread has not referenced
/// this key yet. If the key has been destroyed (which may happen if this is called
/// in a destructor), this function will return an [`AccessError`](struct.AccessError.html).
/// in a destructor), this function will return an [`AccessError`].
///
/// # Panics
///
......
......@@ -137,7 +137,6 @@
//! [`thread::current`]: current
//! [`thread::Result`]: Result
//! [`unpark`]: Thread::unpark
//! [`Thread::name`]: Thread::name
//! [`thread::park_timeout`]: park_timeout
//! [`Cell`]: crate::cell::Cell
//! [`RefCell`]: crate::cell::RefCell
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册