1
Fork 0

Move to intra-doc links for task.rs and vec.rs

This commit is contained in:
Surya Midatala 2020-08-16 19:43:42 +05:30
parent 2c3dc04ea4
commit 11f69796ee
2 changed files with 19 additions and 36 deletions

View file

@ -13,11 +13,9 @@ use crate::sync::Arc;
/// ///
/// This trait is a memory-safe and ergonomic alternative to constructing a /// This trait is a memory-safe and ergonomic alternative to constructing a
/// [`RawWaker`]. It supports the common executor design in which the data used /// [`RawWaker`]. It supports the common executor design in which the data used
/// to wake up a task is stored in an [`Arc`][arc]. Some executors (especially /// to wake up a task is stored in an [`Arc`]. Some executors (especially
/// those for embedded systems) cannot use this API, which is why [`RawWaker`] /// those for embedded systems) cannot use this API, which is why [`RawWaker`]
/// exists as an alternative for those systems. /// exists as an alternative for those systems.
///
/// [arc]: ../../std/sync/struct.Arc.html
#[unstable(feature = "wake_trait", issue = "69912")] #[unstable(feature = "wake_trait", issue = "69912")]
pub trait Wake { pub trait Wake {
/// Wake this task. /// Wake this task.

View file

@ -50,12 +50,9 @@
//! v[1] = v[1] + 5; //! v[1] = v[1] + 5;
//! ``` //! ```
//! //!
//! [`Vec<T>`]: ../../std/vec/struct.Vec.html //! [`Vec<T>`]: Vec
//! [`new`]: ../../std/vec/struct.Vec.html#method.new //! [`new`]: Vec::new
//! [`push`]: ../../std/vec/struct.Vec.html#method.push //! [`push`]: Vec::push
//! [`Index`]: ../../std/ops/trait.Index.html
//! [`IndexMut`]: ../../std/ops/trait.IndexMut.html
//! [`vec!`]: ../../std/macro.vec.html
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]
@ -278,22 +275,18 @@ use crate::raw_vec::RawVec;
/// `Vec` does not currently guarantee the order in which elements are dropped. /// `Vec` does not currently guarantee the order in which elements are dropped.
/// The order has changed in the past and may change again. /// The order has changed in the past and may change again.
/// ///
/// [`vec!`]: ../../std/macro.vec.html
/// [`get`]: ../../std/vec/struct.Vec.html#method.get /// [`get`]: ../../std/vec/struct.Vec.html#method.get
/// [`get_mut`]: ../../std/vec/struct.Vec.html#method.get_mut /// [`get_mut`]: ../../std/vec/struct.Vec.html#method.get_mut
/// [`Index`]: ../../std/ops/trait.Index.html /// [`String`]: crate::string::String
/// [`String`]: ../../std/string/struct.String.html /// [`&str`]: type@str
/// [`&str`]: ../../std/primitive.str.html /// [`shrink_to_fit`]: Vec::shrink_to_fit
/// [`Vec::with_capacity`]: ../../std/vec/struct.Vec.html#method.with_capacity /// [`capacity`]: Vec::capacity
/// [`Vec::new`]: ../../std/vec/struct.Vec.html#method.new /// [`mem::size_of::<T>`]: core::mem::size_of
/// [`shrink_to_fit`]: ../../std/vec/struct.Vec.html#method.shrink_to_fit /// [`len`]: Vec::len
/// [`capacity`]: ../../std/vec/struct.Vec.html#method.capacity /// [`push`]: Vec::push
/// [`mem::size_of::<T>`]: ../../std/mem/fn.size_of.html /// [`insert`]: Vec::insert
/// [`len`]: ../../std/vec/struct.Vec.html#method.len /// [`reserve`]: Vec::reserve
/// [`push`]: ../../std/vec/struct.Vec.html#method.push /// [owned slice]: Box
/// [`insert`]: ../../std/vec/struct.Vec.html#method.insert
/// [`reserve`]: ../../std/vec/struct.Vec.html#method.reserve
/// [owned slice]: ../../std/boxed/struct.Box.html
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")] #[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")]
pub struct Vec<T> { pub struct Vec<T> {
@ -430,8 +423,8 @@ impl<T> Vec<T> {
/// that nothing else uses the pointer after calling this /// that nothing else uses the pointer after calling this
/// function. /// function.
/// ///
/// [`String`]: ../../std/string/struct.String.html /// [`String`]: crate::string::String
/// [`dealloc`]: ../../alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc /// [`dealloc`]: crate::alloc::GlobalAlloc::dealloc
/// ///
/// # Examples /// # Examples
/// ///
@ -658,7 +651,7 @@ impl<T> Vec<T> {
/// ///
/// Note that this will drop any excess capacity. /// Note that this will drop any excess capacity.
/// ///
/// [owned slice]: ../../std/boxed/struct.Box.html /// [owned slice]: Box
/// ///
/// # Examples /// # Examples
/// ///
@ -867,7 +860,7 @@ impl<T> Vec<T> {
/// ///
/// [`truncate`]: #method.truncate /// [`truncate`]: #method.truncate
/// [`resize`]: #method.resize /// [`resize`]: #method.resize
/// [`extend`]: ../../std/iter/trait.Extend.html#tymethod.extend /// [`extend`]: Extend::extend
/// [`clear`]: #method.clear /// [`clear`]: #method.clear
/// ///
/// # Safety /// # Safety
@ -1214,8 +1207,6 @@ impl<T> Vec<T> {
/// Removes the last element from a vector and returns it, or [`None`] if it /// Removes the last element from a vector and returns it, or [`None`] if it
/// is empty. /// is empty.
/// ///
/// [`None`]: ../../std/option/enum.Option.html#variant.None
///
/// # Examples /// # Examples
/// ///
/// ``` /// ```
@ -1480,7 +1471,6 @@ impl<T> Vec<T> {
/// ``` /// ```
/// ///
/// [`resize`]: #method.resize /// [`resize`]: #method.resize
/// [`Clone`]: ../../std/clone/trait.Clone.html
#[stable(feature = "vec_resize_with", since = "1.33.0")] #[stable(feature = "vec_resize_with", since = "1.33.0")]
pub fn resize_with<F>(&mut self, new_len: usize, f: F) pub fn resize_with<F>(&mut self, new_len: usize, f: F)
where where
@ -1590,8 +1580,6 @@ impl<T: Clone> Vec<T> {
/// assert_eq!(vec, [1, 2]); /// assert_eq!(vec, [1, 2]);
/// ``` /// ```
/// ///
/// [`Clone`]: ../../std/clone/trait.Clone.html
/// [`Default`]: ../../std/default/trait.Default.html
/// [`resize_with`]: #method.resize_with /// [`resize_with`]: #method.resize_with
#[stable(feature = "vec_resize", since = "1.5.0")] #[stable(feature = "vec_resize", since = "1.5.0")]
pub fn resize(&mut self, new_len: usize, value: T) { pub fn resize(&mut self, new_len: usize, value: T) {
@ -1655,9 +1643,7 @@ impl<T: Default> Vec<T> {
/// ``` /// ```
/// ///
/// [`resize`]: #method.resize /// [`resize`]: #method.resize
/// [`Default::default()`]: ../../std/default/trait.Default.html#tymethod.default /// [`Default::default()`]: Default::default
/// [`Default`]: ../../std/default/trait.Default.html
/// [`Clone`]: ../../std/clone/trait.Clone.html
#[unstable(feature = "vec_resize_default", issue = "41758")] #[unstable(feature = "vec_resize_default", issue = "41758")]
#[rustc_deprecated( #[rustc_deprecated(
reason = "This is moving towards being removed in favor \ reason = "This is moving towards being removed in favor \
@ -2338,7 +2324,6 @@ impl<T> Vec<T> {
/// Note that `drain_filter` also lets you mutate every element in the filter closure, /// Note that `drain_filter` also lets you mutate every element in the filter closure,
/// regardless of whether you choose to keep or remove it. /// regardless of whether you choose to keep or remove it.
/// ///
///
/// # Examples /// # Examples
/// ///
/// Splitting an array into evens and odds, reusing the original allocation: /// Splitting an array into evens and odds, reusing the original allocation: