Skip to content

Commit ca4867c

Browse files
Fix docs for tokio feature
1 parent b6463fb commit ca4867c

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ jobs:
6262
runs-on: ubuntu-latest
6363
steps:
6464
- uses: actions/checkout@v4
65-
- uses: dtolnay/rust-toolchain@stable
65+
- uses: dtolnay/rust-toolchain@nightly
6666
- run: cargo test --doc
6767
- run: cargo doc --lib --no-deps --all-features --document-private-items
6868
env:
69-
RUSTDOCFLAGS: -Dwarnings
70-
RUSTFLAGS: -Dwarnings
69+
RUSTFLAGS: --cfg docsrs -Dwarnings
70+
RUSTDOCFLAGS: --cfg docsrs -Dwarnings

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ tokio = { version = "1.48.0", features = ["time", "io-util"] }
2424

2525
[profile.dev]
2626
opt-level = 3
27+
28+
[package.metadata.docs.rs]
29+
all-features = true
30+
rustdoc-args = ["--cfg", "docsrs"]
31+
rustc-args = ["--cfg", "docsrs"]

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
#![cfg_attr(docsrs, feature(doc_cfg))]
2+
13
pub mod sealed;
24
pub mod shared;
35
#[cfg(feature = "tokio")]
6+
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
47
pub mod split;
58
pub mod stopwatch;
69
pub mod sync;
@@ -15,6 +18,7 @@ pub mod prelude {
1518
pub use crate::sync::error as local_sync_error;
1619
pub use crate::sync::oneshot as local_oneshot;
1720
#[cfg(feature = "tokio")]
21+
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
1822
pub use crate::sync::pipe as local_pipe;
1923
pub use crate::sync::semaphore as local_semaphore;
2024
pub use crate::sync::unbounded as local_unbounded;

src/sync/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pub mod condvar;
55
pub mod error;
66
pub mod oneshot;
77
#[cfg(feature = "tokio")]
8+
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
89
pub mod pipe;
910
pub mod semaphore;
1011
mod shared_state;

0 commit comments

Comments
 (0)