Skip to content

Commit 1d3a488

Browse files
committed
Enable the doc_cfg nightly feature
Following rust-lang/rust#89596 it now docs all `cfg` attributes.
1 parent 285420c commit 1d3a488

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
const_fn_trait_bound,
7474
const_option,
7575
destructuring_assignment,
76+
doc_cfg,
77+
doc_cfg_hide,
7678
drain_filter,
7779
generic_associated_types,
7880
io_slice_advance,
@@ -105,6 +107,12 @@
105107
#![cfg_attr(test, deny(warnings))]
106108
// Disallow warnings in examples, we want to set a good example after all.
107109
#![doc(test(attr(deny(warnings))))]
110+
// The `cfg(any(test, feature = "test"))` attribute creates a doc element
111+
// staying that it's only supporting "using test or test", that is a bit
112+
// confusing. So we hide those parts and instead manually replace all of them
113+
// with: `doc(cfg(feature = "test"))`. That will stay it's only supported using
114+
// the test feature.
115+
#![doc(cfg_hide(any(test, feature = "test")))]
108116

109117
#[cfg(not(any(target_os = "linux", target_os = "freebsd", target_os = "macos")))]
110118
compile_error!("Heph currently only supports Linux, FreeBSD and macOS.");
@@ -121,6 +129,7 @@ pub mod rt;
121129
pub mod spawn;
122130
pub mod supervisor;
123131
#[cfg(any(test, feature = "test"))]
132+
#[doc(cfg(feature = "test"))]
124133
pub mod test;
125134
pub mod timer;
126135
pub mod trace;

src/rt/shared/waker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use crate::rt::shared::RuntimeInternals;
88
use crate::rt::{ptr_as_usize, ProcessId};
99

1010
/// Maximum number of runtimes supported.
11-
pub const MAX_RUNTIMES: usize = 1 << MAX_RUNTIMES_BITS;
11+
pub(crate) const MAX_RUNTIMES: usize = 1 << MAX_RUNTIMES_BITS;
1212
#[cfg(not(any(test, feature = "test")))]
13-
pub const MAX_RUNTIMES_BITS: usize = 0; // 1.
13+
pub(crate) const MAX_RUNTIMES_BITS: usize = 0; // 1.
1414
#[cfg(any(test, feature = "test"))]
15-
pub const MAX_RUNTIMES_BITS: usize = 5; // 32.
15+
pub(crate) const MAX_RUNTIMES_BITS: usize = 5; // 32.
1616

1717
/// An id for a waker.
1818
///

0 commit comments

Comments
 (0)