Skip to content

Commit

Permalink
Use #[doc(no_inline)] on re-exports from core/std (#2324)
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jan 17, 2021
1 parent 4124111 commit 0ae6d1e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
1 change: 1 addition & 0 deletions futures-core/src/future.rs
Expand Up @@ -4,6 +4,7 @@ use core::ops::DerefMut;
use core::pin::Pin;
use core::task::{Context, Poll};

#[doc(no_inline)]
pub use core::future::Future;

/// An owned dynamically typed [`Future`] for use in cases where you can't
Expand Down
1 change: 1 addition & 0 deletions futures-core/src/task/mod.rs
Expand Up @@ -6,4 +6,5 @@ mod poll;
#[doc(hidden)]
pub mod __internal;

#[doc(no_inline)]
pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
14 changes: 4 additions & 10 deletions futures-io/src/lib.rs
Expand Up @@ -33,19 +33,13 @@ mod if_std {
// Re-export some types from `std::io` so that users don't have to deal
// with conflicts when `use`ing `futures::io` and `std::io`.
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411
pub use io::{
Error as Error,
ErrorKind as ErrorKind,
Result as Result,
IoSlice as IoSlice,
IoSliceMut as IoSliceMut,
SeekFrom as SeekFrom,
};

#[doc(no_inline)]
pub use io::{Error, ErrorKind, Result, IoSlice, IoSliceMut, SeekFrom};
#[cfg(feature = "read-initializer")]
#[cfg_attr(docsrs, doc(cfg(feature = "read-initializer")))]
#[doc(no_inline)]
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411
pub use io::Initializer as Initializer;
pub use io::Initializer;

/// Read bytes asynchronously.
///
Expand Down
1 change: 1 addition & 0 deletions futures-task/src/lib.rs
Expand Up @@ -51,4 +51,5 @@ pub use crate::noop_waker::noop_waker;
#[cfg(feature = "std")]
pub use crate::noop_waker::noop_waker_ref;

#[doc(no_inline)]
pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
5 changes: 4 additions & 1 deletion futures-util/src/future/mod.rs
Expand Up @@ -9,9 +9,12 @@
//! from a closure that defines its return value, and [`ready`](ready()),
//! which constructs a future with an immediate defined value.

#[doc(no_inline)]
pub use core::future::Future;

#[cfg(feature = "alloc")]
pub use futures_core::future::{BoxFuture, LocalBoxFuture};
pub use futures_core::future::{FusedFuture, Future, TryFuture};
pub use futures_core::future::{FusedFuture, TryFuture};
pub use futures_task::{FutureObj, LocalFutureObj, UnsafeFutureObj};

// Extension traits and combinators
Expand Down
13 changes: 8 additions & 5 deletions futures-util/src/io/mod.rs
Expand Up @@ -23,13 +23,16 @@ use crate::future::assert_future;
use crate::stream::assert_stream;
use std::{ptr, pin::Pin};

pub use futures_io::{
AsyncRead, AsyncWrite, AsyncSeek, AsyncBufRead, Error, ErrorKind,
IoSlice, IoSliceMut, Result, SeekFrom,
};
// Re-export some types from `std::io` so that users don't have to deal
// with conflicts when `use`ing `futures::io` and `std::io`.
#[doc(no_inline)]
pub use std::io::{Error, ErrorKind, IoSlice, IoSliceMut, Result, SeekFrom};
#[doc(no_inline)]
#[cfg(feature = "read-initializer")]
#[cfg_attr(docsrs, doc(cfg(feature = "read-initializer")))]
pub use futures_io::Initializer;
pub use std::io::Initializer;

pub use futures_io::{AsyncRead, AsyncWrite, AsyncSeek, AsyncBufRead};

// used by `BufReader` and `BufWriter`
// https://github.com/rust-lang/rust/blob/master/src/libstd/sys_common/io.rs#L1
Expand Down
3 changes: 2 additions & 1 deletion futures-util/src/task/mod.rs
Expand Up @@ -10,7 +10,8 @@
//! The remaining types and traits in the module are used for implementing
//! executors or dealing with synchronization issues around task wakeup.

pub use futures_core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
#[doc(no_inline)]
pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};

pub use futures_task::{
Spawn, LocalSpawn, SpawnError,
Expand Down

0 comments on commit 0ae6d1e

Please sign in to comment.