Skip to content

Commit dd17708

Browse files
committed
Add more doc(cfg(feature = "...")) hints.
1 parent 6ae6e2e commit dd17708

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

src/io/is_read_write.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
//!
33
//! [`is_read_write`]: https://docs.rs/rustix/*/rustix/io/fn.is_read_write.html
44
5-
#[cfg(all(feature = "fs", feature = "net"))]
65
use crate::{backend, io};
7-
#[cfg(all(feature = "fs", feature = "net"))]
86
use backend::fd::AsFd;
97

108
/// Returns a pair of booleans indicating whether the file descriptor is
@@ -15,7 +13,6 @@ use backend::fd::AsFd;
1513
///
1614
/// [`is_file_read_write`]: crate::fs::is_file_read_write
1715
#[inline]
18-
#[cfg(all(feature = "fs", feature = "net"))]
1916
#[cfg_attr(doc_cfg, doc(cfg(all(feature = "fs", feature = "net"))))]
2017
pub fn is_read_write<Fd: AsFd>(fd: Fd) -> io::Result<(bool, bool)> {
2118
backend::io::syscalls::is_read_write(fd.as_fd())

src/io/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mod fcntl;
1212
pub(crate) mod fd;
1313
mod ioctl;
1414
#[cfg(not(any(windows, target_os = "redox")))]
15+
#[cfg(all(feature = "fs", feature = "net"))]
1516
mod is_read_write;
1617
#[cfg(bsd)]
1718
pub mod kqueue;
@@ -41,7 +42,7 @@ pub use fcntl::*;
4142
pub use ioctl::*;
4243
#[cfg(not(any(windows, target_os = "redox")))]
4344
#[cfg(all(feature = "fs", feature = "net"))]
44-
pub use is_read_write::is_read_write;
45+
pub use is_read_write::*;
4546
#[cfg(not(any(windows, target_os = "wasi")))]
4647
pub use pipe::*;
4748
pub use poll::{poll, PollFd, PollFlags};

src/path/dec_int.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ use {core::fmt, std::ffi::OsStr, std::path::Path};
2525
/// # Example
2626
///
2727
/// ```
28-
/// # #[cfg(feature = "path")]
28+
/// # #[cfg(any(feature = "fs", feature = "net"))]
2929
/// use rustix::path::DecInt;
3030
///
31-
/// # #[cfg(feature = "path")]
31+
/// # #[cfg(any(feature = "fs", feature = "net"))]
3232
/// assert_eq!(
3333
/// format!("hello {}", DecInt::new(9876).as_ref().display()),
3434
/// "hello 9876"

src/path/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ mod dec_int;
66

77
pub use arg::Arg;
88
#[cfg(feature = "itoa")]
9+
#[cfg_attr(doc_cfg, doc(cfg(feature = "itoa")))]
910
pub use dec_int::DecInt;
1011

1112
pub(crate) const SMALL_PATH_BUFFER_SIZE: usize = 256;

src/process/umask.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use crate::fs::Mode;
1313
///
1414
/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/umask.html
1515
/// [Linux]: https://man7.org/linux/man-pages/man2/umask.2.html
16-
#[inline]
17-
#[cfg_attr(doc_cfg, doc(cfg(feature = "fs")))]
1816
#[cfg(feature = "fs")]
17+
#[cfg_attr(doc_cfg, doc(cfg(feature = "fs")))]
18+
#[inline]
1919
pub fn umask(mask: Mode) -> Mode {
2020
backend::process::syscalls::umask(mask)
2121
}

src/time/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
33
mod clock;
44
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
5-
#[cfg(feature = "time")]
65
mod timerfd;
76

87
// TODO: Convert WASI'S clock APIs to use handles rather than ambient clock
98
// identifiers, update `wasi-libc`, and then add support in `rustix`.
109
pub use clock::*;
1110
#[cfg(any(linux_kernel, target_os = "fuchsia"))]
12-
#[cfg(feature = "time")]
1311
pub use timerfd::*;

0 commit comments

Comments
 (0)