Use more std:: instead of core:: in docs for consistency, add more intra doc links
This commit is contained in:
parent
c4926d01ad
commit
4eb76fcc8e
7 changed files with 20 additions and 17 deletions
|
@ -403,7 +403,7 @@ impl<'a> Arguments<'a> {
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// #![feature(fmt_as_str)]
|
/// #![feature(fmt_as_str)]
|
||||||
///
|
///
|
||||||
/// use core::fmt::Arguments;
|
/// use std::fmt::Arguments;
|
||||||
///
|
///
|
||||||
/// fn write_str(_: &str) { /* ... */ }
|
/// fn write_str(_: &str) { /* ... */ }
|
||||||
///
|
///
|
||||||
|
|
|
@ -21,7 +21,7 @@ pub struct Pending<T> {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
/// use core::future;
|
/// use std::future;
|
||||||
///
|
///
|
||||||
/// # async fn run() {
|
/// # async fn run() {
|
||||||
/// let future = future::pending();
|
/// let future = future::pending();
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::future::Future;
|
||||||
use crate::pin::Pin;
|
use crate::pin::Pin;
|
||||||
use crate::task::{Context, Poll};
|
use crate::task::{Context, Poll};
|
||||||
|
|
||||||
/// Creates a future that wraps a function returning `Poll`.
|
/// Creates a future that wraps a function returning [`Poll`].
|
||||||
///
|
///
|
||||||
/// Polling the future delegates to the wrapped function.
|
/// Polling the future delegates to the wrapped function.
|
||||||
///
|
///
|
||||||
|
@ -13,7 +13,7 @@ use crate::task::{Context, Poll};
|
||||||
/// #![feature(future_poll_fn)]
|
/// #![feature(future_poll_fn)]
|
||||||
/// # async fn run() {
|
/// # async fn run() {
|
||||||
/// use core::future::poll_fn;
|
/// use core::future::poll_fn;
|
||||||
/// use core::task::{Context, Poll};
|
/// use std::task::{Context, Poll};
|
||||||
///
|
///
|
||||||
/// fn read_line(_cx: &mut Context<'_>) -> Poll<String> {
|
/// fn read_line(_cx: &mut Context<'_>) -> Poll<String> {
|
||||||
/// Poll::Ready("Hello, World!".into())
|
/// Poll::Ready("Hello, World!".into())
|
||||||
|
@ -31,7 +31,7 @@ where
|
||||||
PollFn { f }
|
PollFn { f }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A Future that wraps a function returning `Poll`.
|
/// A Future that wraps a function returning [`Poll`].
|
||||||
///
|
///
|
||||||
/// This `struct` is created by [`poll_fn()`]. See its
|
/// This `struct` is created by [`poll_fn()`]. See its
|
||||||
/// documentation for more.
|
/// documentation for more.
|
||||||
|
|
|
@ -33,7 +33,7 @@ impl<T> Future for Ready<T> {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use core::future;
|
/// use std::future;
|
||||||
///
|
///
|
||||||
/// # async fn run() {
|
/// # async fn run() {
|
||||||
/// let a = future::ready(1);
|
/// let a = future::ready(1);
|
||||||
|
|
|
@ -189,7 +189,7 @@ impl<'a> Location<'a> {
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use core::panic::Location;
|
/// use std::panic::Location;
|
||||||
///
|
///
|
||||||
/// /// Returns the [`Location`] at which it is called.
|
/// /// Returns the [`Location`] at which it is called.
|
||||||
/// #[track_caller]
|
/// #[track_caller]
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
/// Extracts the successful type of a `Poll<T>`.
|
/// Extracts the successful type of a [`Poll<T>`].
|
||||||
///
|
///
|
||||||
/// This macro bakes in propagation of `Pending` signals by returning early.
|
/// This macro bakes in propagation of [`Pending`] signals by returning early.
|
||||||
|
///
|
||||||
|
/// [`Poll<T>`]: crate::task::Poll
|
||||||
|
/// [`Pending`]: crate::task::Poll::Pending
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #![feature(ready_macro)]
|
/// #![feature(ready_macro)]
|
||||||
///
|
///
|
||||||
/// use core::task::{ready, Context, Poll};
|
/// use std::task::{ready, Context, Poll};
|
||||||
/// use core::future::{self, Future};
|
/// use std::future::{self, Future};
|
||||||
/// use core::pin::Pin;
|
/// use std::pin::Pin;
|
||||||
///
|
///
|
||||||
/// pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> {
|
/// pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> {
|
||||||
/// let mut fut = future::ready(42);
|
/// let mut fut = future::ready(42);
|
||||||
|
@ -28,9 +31,9 @@
|
||||||
/// ```
|
/// ```
|
||||||
/// # #![feature(ready_macro)]
|
/// # #![feature(ready_macro)]
|
||||||
/// #
|
/// #
|
||||||
/// # use core::task::{Context, Poll};
|
/// # use std::task::{Context, Poll};
|
||||||
/// # use core::future::{self, Future};
|
/// # use std::future::{self, Future};
|
||||||
/// # use core::pin::Pin;
|
/// # use std::pin::Pin;
|
||||||
/// #
|
/// #
|
||||||
/// # pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> {
|
/// # pub fn do_poll(cx: &mut Context<'_>) -> Poll<()> {
|
||||||
/// # let mut fut = future::ready(42);
|
/// # let mut fut = future::ready(42);
|
||||||
|
|
|
@ -198,7 +198,7 @@ mod prim_bool {}
|
||||||
/// words, they can't return `!` from every code path. As an example, this code doesn't compile:
|
/// words, they can't return `!` from every code path. As an example, this code doesn't compile:
|
||||||
///
|
///
|
||||||
/// ```compile_fail
|
/// ```compile_fail
|
||||||
/// use core::ops::Add;
|
/// use std::ops::Add;
|
||||||
///
|
///
|
||||||
/// fn foo() -> impl Add<u32> {
|
/// fn foo() -> impl Add<u32> {
|
||||||
/// unimplemented!()
|
/// unimplemented!()
|
||||||
|
@ -208,7 +208,7 @@ mod prim_bool {}
|
||||||
/// But this code does:
|
/// But this code does:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// use core::ops::Add;
|
/// use std::ops::Add;
|
||||||
///
|
///
|
||||||
/// fn foo() -> impl Add<u32> {
|
/// fn foo() -> impl Add<u32> {
|
||||||
/// if true {
|
/// if true {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue