Skip to content

Commit

Permalink
Fix rustdoc::redundant_explicit_links warning (#2769)
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored Aug 23, 2023
1 parent 89c06f5 commit e9bda1d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
13 changes: 6 additions & 7 deletions futures-channel/src/mpsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,27 @@ impl<T> Unpin for BoundedSenderInner<T> {}

/// The transmission end of a bounded mpsc channel.
///
/// This value is created by the [`channel`](channel) function.
/// This value is created by the [`channel`] function.
pub struct Sender<T>(Option<BoundedSenderInner<T>>);

/// The transmission end of an unbounded mpsc channel.
///
/// This value is created by the [`unbounded`](unbounded) function.
/// This value is created by the [`unbounded`] function.
pub struct UnboundedSender<T>(Option<UnboundedSenderInner<T>>);

trait AssertKinds: Send + Sync + Clone {}
impl AssertKinds for UnboundedSender<u32> {}

/// The receiving end of a bounded mpsc channel.
///
/// This value is created by the [`channel`](channel) function.
/// This value is created by the [`channel`] function.
pub struct Receiver<T> {
inner: Option<Arc<BoundedInner<T>>>,
}

/// The receiving end of an unbounded mpsc channel.
///
/// This value is created by the [`unbounded`](unbounded) function.
/// This value is created by the [`unbounded`] function.
pub struct UnboundedReceiver<T> {
inner: Option<Arc<UnboundedInner<T>>>,
}
Expand Down Expand Up @@ -337,9 +337,8 @@ impl SenderTask {
/// guaranteed slot in the channel capacity, and on top of that there are
/// `buffer` "first come, first serve" slots available to all senders.
///
/// The [`Receiver`](Receiver) returned implements the
/// [`Stream`](futures_core::stream::Stream) trait, while [`Sender`](Sender) implements
/// `Sink`.
/// The [`Receiver`] returned implements the [`Stream`] trait, while [`Sender`]
/// implements `Sink`.
pub fn channel<T>(buffer: usize) -> (Sender<T>, Receiver<T>) {
// Check that the requested buffer size does not exceed the maximum buffer
// size permitted by the system.
Expand Down
18 changes: 9 additions & 9 deletions futures-channel/src/oneshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ use crate::lock::Lock;

/// A future for a value that will be provided by another asynchronous task.
///
/// This is created by the [`channel`](channel) function.
/// This is created by the [`channel`] function.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct Receiver<T> {
inner: Arc<Inner<T>>,
}

/// A means of transmitting a single value to another task.
///
/// This is created by the [`channel`](channel) function.
/// This is created by the [`channel`] function.
pub struct Sender<T> {
inner: Arc<Inner<T>>,
}
Expand Down Expand Up @@ -332,8 +332,8 @@ impl<T> Sender<T> {
/// Completes this oneshot with a successful result.
///
/// This function will consume `self` and indicate to the other end, the
/// [`Receiver`](Receiver), that the value provided is the result of the
/// computation this represents.
/// [`Receiver`], that the value provided is the result of the computation
/// this represents.
///
/// If the value is successfully enqueued for the remote end to receive,
/// then `Ok(())` is returned. If the receiving end was dropped before
Expand All @@ -343,7 +343,7 @@ impl<T> Sender<T> {
}

/// Polls this `Sender` half to detect whether its associated
/// [`Receiver`](Receiver) has been dropped.
/// [`Receiver`] has been dropped.
///
/// # Return values
///
Expand All @@ -359,10 +359,10 @@ impl<T> Sender<T> {
}

/// Creates a future that resolves when this `Sender`'s corresponding
/// [`Receiver`](Receiver) half has hung up.
/// [`Receiver`] half has hung up.
///
/// This is a utility wrapping [`poll_canceled`](Sender::poll_canceled)
/// to expose a [`Future`](core::future::Future).
/// to expose a [`Future`].
pub fn cancellation(&mut self) -> Cancellation<'_, T> {
Cancellation { inner: self }
}
Expand Down Expand Up @@ -413,8 +413,8 @@ impl<T> Future for Cancellation<'_, T> {
}
}

/// Error returned from a [`Receiver`](Receiver) when the corresponding
/// [`Sender`](Sender) is dropped.
/// Error returned from a [`Receiver`] when the corresponding [`Sender`] is
/// dropped.
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct Canceled;

Expand Down
2 changes: 1 addition & 1 deletion futures-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mod interleave_pending;
mod track_closed;

/// Enables an `async` test function. The generated future will be run to completion with
/// [`futures_executor::block_on`](futures_executor::block_on).
/// [`futures_executor::block_on`].
///
/// ```
/// #[futures_test::test]
Expand Down
20 changes: 10 additions & 10 deletions futures-test/src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@
//! [`Spawn`](futures_task::Spawn) implementations.
//!
//! Test contexts:
//! - [`noop_context`](crate::task::noop_context) creates a context that ignores calls to
//! - [`noop_context`] creates a context that ignores calls to
//! [`cx.waker().wake_by_ref()`](futures_core::task::Waker).
//! - [`panic_context`](crate::task::panic_context) creates a context that panics when
//! - [`panic_context`] creates a context that panics when
//! [`cx.waker().wake_by_ref()`](futures_core::task::Waker) is called.
//!
//! Test wakers:
//! - [`noop_waker`](crate::task::noop_waker) creates a waker that ignores calls to
//! - [`noop_waker`] creates a waker that ignores calls to
//! [`wake`](futures_core::task::Waker).
//! - [`panic_waker`](crate::task::panic_waker()) creates a waker that panics when
//! - [`panic_waker`](panic_waker()) creates a waker that panics when
//! [`wake`](futures_core::task::Waker) is called.
//! - [`new_count_waker`](crate::task::new_count_waker) creates a waker that increments a counter whenever
//! - [`new_count_waker`] creates a waker that increments a counter whenever
//! [`wake`](futures_core::task::Waker) is called.
//!
//! Test spawners:
//! - [`NoopSpawner`](crate::task::NoopSpawner) ignores calls to
//! - [`NoopSpawner`] ignores calls to
//! [`spawn`](futures_util::task::SpawnExt::spawn)
//! - [`PanicSpawner`](crate::task::PanicSpawner) panics if [`spawn`](futures_util::task::SpawnExt::spawn) is
//! - [`PanicSpawner`] panics if [`spawn`](futures_util::task::SpawnExt::spawn) is
//! called.
//! - [`RecordSpawner`](crate::task::RecordSpawner) records the spawned futures.
//! - [`RecordSpawner`] records the spawned futures.
//!
//! For convenience there additionally exist various functions that directly
//! return waker/spawner references: [`noop_waker_ref`](crate::task::noop_waker_ref),
//! [`panic_waker_ref`](crate::task::panic_waker_ref), [`noop_spawner_mut`](crate::task::noop_spawner_mut) and [`panic_spawner_mut`](crate::task::panic_spawner_mut).
//! return waker/spawner references: [`noop_waker_ref`], [`panic_waker_ref`],
//! [`noop_spawner_mut`] and [`panic_spawner_mut`].

mod context;
pub use self::context::{noop_context, panic_context};
Expand Down

0 comments on commit e9bda1d

Please sign in to comment.