Skip to content

Commit 6bacfe0

Browse files
authored
refactor: remove legacy #[doc(cfg(all()))] attributes (#2192)
* refactor: remove legacy #[doc(cfg(all()))] attributes * fix macOS * revert unintended change
1 parent 62bf9f1 commit 6bacfe0

28 files changed

+0
-622
lines changed

src/fcntl.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ libc_bitflags!(
7373
O_ACCMODE;
7474
/// Use alternate I/O semantics.
7575
#[cfg(target_os = "netbsd")]
76-
#[cfg_attr(docsrs, doc(cfg(all())))]
7776
O_ALT_IO;
7877
/// Open the file in append-only mode.
7978
O_APPEND;
@@ -82,7 +81,6 @@ libc_bitflags!(
8281
target_os = "illumos",
8382
target_os = "solaris",
8483
target_os = "haiku")))]
85-
#[cfg_attr(docsrs, doc(cfg(all())))]
8684
O_ASYNC;
8785
/// Closes the file descriptor once an `execve` call is made.
8886
///
@@ -96,25 +94,21 @@ libc_bitflags!(
9694
target_os = "freebsd",
9795
target_os = "linux",
9896
target_os = "netbsd"))]
99-
#[cfg_attr(docsrs, doc(cfg(all())))]
10097
O_DIRECT;
10198
/// If the specified path isn't a directory, fail.
10299
#[cfg(not(any(target_os = "illumos", target_os = "solaris")))]
103-
#[cfg_attr(docsrs, doc(cfg(all())))]
104100
O_DIRECTORY;
105101
/// Implicitly follow each `write()` with an `fdatasync()`.
106102
#[cfg(any(target_os = "android",
107103
apple_targets,
108104
target_os = "linux",
109105
target_os = "netbsd",
110106
target_os = "openbsd"))]
111-
#[cfg_attr(docsrs, doc(cfg(all())))]
112107
O_DSYNC;
113108
/// Error out if a file was not created.
114109
O_EXCL;
115110
/// Open for execute only.
116111
#[cfg(target_os = "freebsd")]
117-
#[cfg_attr(docsrs, doc(cfg(all())))]
118112
O_EXEC;
119113
/// Open with an exclusive file lock.
120114
#[cfg(any(target_os = "dragonfly",
@@ -123,7 +117,6 @@ libc_bitflags!(
123117
target_os = "netbsd",
124118
target_os = "openbsd",
125119
target_os = "redox"))]
126-
#[cfg_attr(docsrs, doc(cfg(all())))]
127120
O_EXLOCK;
128121
/// Same as `O_SYNC`.
129122
#[cfg(any(target_os = "dragonfly",
@@ -133,37 +126,30 @@ libc_bitflags!(
133126
target_os = "netbsd",
134127
target_os = "openbsd",
135128
target_os = "redox"))]
136-
#[cfg_attr(docsrs, doc(cfg(all())))]
137129
O_FSYNC;
138130
/// Allow files whose sizes can't be represented in an `off_t` to be opened.
139131
#[cfg(any(target_os = "android", target_os = "linux"))]
140-
#[cfg_attr(docsrs, doc(cfg(all())))]
141132
O_LARGEFILE;
142133
/// Do not update the file last access time during `read(2)`s.
143134
#[cfg(any(target_os = "android", target_os = "linux"))]
144-
#[cfg_attr(docsrs, doc(cfg(all())))]
145135
O_NOATIME;
146136
/// Don't attach the device as the process' controlling terminal.
147137
#[cfg(not(target_os = "redox"))]
148-
#[cfg_attr(docsrs, doc(cfg(all())))]
149138
O_NOCTTY;
150139
/// Same as `O_NONBLOCK`.
151140
#[cfg(not(any(target_os = "redox", target_os = "haiku")))]
152-
#[cfg_attr(docsrs, doc(cfg(all())))]
153141
O_NDELAY;
154142
/// `open()` will fail if the given path is a symbolic link.
155143
O_NOFOLLOW;
156144
/// When possible, open the file in nonblocking mode.
157145
O_NONBLOCK;
158146
/// Don't deliver `SIGPIPE`.
159147
#[cfg(target_os = "netbsd")]
160-
#[cfg_attr(docsrs, doc(cfg(all())))]
161148
O_NOSIGPIPE;
162149
/// Obtain a file descriptor for low-level access.
163150
///
164151
/// The file itself is not opened and other file operations will fail.
165152
#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox"))]
166-
#[cfg_attr(docsrs, doc(cfg(all())))]
167153
O_PATH;
168154
/// Only allow reading.
169155
///
@@ -175,11 +161,9 @@ libc_bitflags!(
175161
O_RDWR;
176162
/// Similar to `O_DSYNC` but applies to `read`s instead.
177163
#[cfg(any(target_os = "linux", target_os = "netbsd", target_os = "openbsd"))]
178-
#[cfg_attr(docsrs, doc(cfg(all())))]
179164
O_RSYNC;
180165
/// Skip search permission checks.
181166
#[cfg(target_os = "netbsd")]
182-
#[cfg_attr(docsrs, doc(cfg(all())))]
183167
O_SEARCH;
184168
/// Open with a shared file lock.
185169
#[cfg(any(target_os = "dragonfly",
@@ -188,21 +172,17 @@ libc_bitflags!(
188172
target_os = "netbsd",
189173
target_os = "openbsd",
190174
target_os = "redox"))]
191-
#[cfg_attr(docsrs, doc(cfg(all())))]
192175
O_SHLOCK;
193176
/// Implicitly follow each `write()` with an `fsync()`.
194177
#[cfg(not(target_os = "redox"))]
195-
#[cfg_attr(docsrs, doc(cfg(all())))]
196178
O_SYNC;
197179
/// Create an unnamed temporary file.
198180
#[cfg(any(target_os = "android", target_os = "linux"))]
199-
#[cfg_attr(docsrs, doc(cfg(all())))]
200181
O_TMPFILE;
201182
/// Truncate an existing regular file to 0 length if it allows writing.
202183
O_TRUNC;
203184
/// Restore default TTY attributes.
204185
#[cfg(target_os = "freebsd")]
205-
#[cfg_attr(docsrs, doc(cfg(all())))]
206186
O_TTY_INIT;
207187
/// Only allow writing.
208188
///

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
//! * `zerocopy` - APIs like `sendfile` and `copy_file_range`
4242
#![crate_name = "nix"]
4343
#![cfg(unix)]
44-
#![cfg_attr(docsrs, doc(cfg(all())))]
4544
#![allow(non_camel_case_types)]
4645
#![cfg_attr(test, deny(warnings))]
4746
#![recursion_limit = "500"]

src/mount/bsd.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,29 @@ libc_bitflags!(
1717
pub struct MntFlags: c_int {
1818
/// ACL support enabled.
1919
#[cfg(any(target_os = "netbsd", target_os = "freebsd"))]
20-
#[cfg_attr(docsrs, doc(cfg(all())))]
2120
MNT_ACLS;
2221
/// All I/O to the file system should be done asynchronously.
2322
MNT_ASYNC;
2423
/// dir should instead be a file system ID encoded as “FSID:val0:val1”.
2524
#[cfg(target_os = "freebsd")]
26-
#[cfg_attr(docsrs, doc(cfg(all())))]
2725
MNT_BYFSID;
2826
/// Force a read-write mount even if the file system appears to be
2927
/// unclean.
3028
MNT_FORCE;
3129
/// GEOM journal support enabled.
3230
#[cfg(target_os = "freebsd")]
33-
#[cfg_attr(docsrs, doc(cfg(all())))]
3431
MNT_GJOURNAL;
3532
/// MAC support for objects.
3633
#[cfg(any(target_os = "macos", target_os = "freebsd"))]
37-
#[cfg_attr(docsrs, doc(cfg(all())))]
3834
MNT_MULTILABEL;
3935
/// Disable read clustering.
4036
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
41-
#[cfg_attr(docsrs, doc(cfg(all())))]
4237
MNT_NOCLUSTERR;
4338
/// Disable write clustering.
4439
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
45-
#[cfg_attr(docsrs, doc(cfg(all())))]
4640
MNT_NOCLUSTERW;
4741
/// Enable NFS version 4 ACLs.
4842
#[cfg(target_os = "freebsd")]
49-
#[cfg_attr(docsrs, doc(cfg(all())))]
5043
MNT_NFS4ACLS;
5144
/// Do not update access times.
5245
MNT_NOATIME;
@@ -56,7 +49,6 @@ libc_bitflags!(
5649
MNT_NOSUID;
5750
/// Do not follow symlinks.
5851
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
59-
#[cfg_attr(docsrs, doc(cfg(all())))]
6052
MNT_NOSYMFOLLOW;
6153
/// Mount read-only.
6254
MNT_RDONLY;
@@ -67,7 +59,6 @@ libc_bitflags!(
6759
///
6860
/// See [mksnap_ffs(8)](https://www.freebsd.org/cgi/man.cgi?query=mksnap_ffs)
6961
#[cfg(any(target_os = "macos", target_os = "freebsd"))]
70-
#[cfg_attr(docsrs, doc(cfg(all())))]
7162
MNT_SNAPSHOT;
7263
/// Using soft updates.
7364
#[cfg(any(
@@ -76,12 +67,10 @@ libc_bitflags!(
7667
target_os = "netbsd",
7768
target_os = "openbsd"
7869
))]
79-
#[cfg_attr(docsrs, doc(cfg(all())))]
8070
MNT_SOFTDEP;
8171
/// Directories with the SUID bit set chown new files to their own
8272
/// owner.
8373
#[cfg(any(target_os = "dragonfly", target_os = "freebsd"))]
84-
#[cfg_attr(docsrs, doc(cfg(all())))]
8574
MNT_SUIDDIR;
8675
/// All I/O to the file system should be done synchronously.
8776
MNT_SYNCHRONOUS;
@@ -91,14 +80,12 @@ libc_bitflags!(
9180
target_os = "freebsd",
9281
target_os = "netbsd"
9382
))]
94-
#[cfg_attr(docsrs, doc(cfg(all())))]
9583
MNT_UNION;
9684
/// Indicates that the mount command is being applied to an already
9785
/// mounted file system.
9886
MNT_UPDATE;
9987
/// Check vnode use counts.
10088
#[cfg(target_os = "freebsd")]
101-
#[cfg_attr(docsrs, doc(cfg(all())))]
10289
MNT_NONBUSY;
10390
}
10491
);
@@ -198,7 +185,6 @@ pub type NmountResult = std::result::Result<(), NmountError>;
198185
/// * [`nmount(2)`](https://www.freebsd.org/cgi/man.cgi?query=nmount)
199186
/// * [`nullfs(5)`](https://www.freebsd.org/cgi/man.cgi?query=nullfs)
200187
#[cfg(target_os = "freebsd")]
201-
#[cfg_attr(docsrs, doc(cfg(all())))]
202188
#[derive(Debug, Default)]
203189
pub struct Nmount<'a> {
204190
// n.b. notgull: In reality, this is a list that contains
@@ -210,7 +196,6 @@ pub struct Nmount<'a> {
210196
}
211197

212198
#[cfg(target_os = "freebsd")]
213-
#[cfg_attr(docsrs, doc(cfg(all())))]
214199
impl<'a> Nmount<'a> {
215200
/// Helper function to push a slice onto the `iov` array.
216201
fn push_slice(&mut self, val: &'a [u8], is_owned: bool) {

src/mount/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Mount file systems
22
#[cfg(any(target_os = "android", target_os = "linux"))]
3-
#[cfg_attr(docsrs, doc(cfg(all())))]
43
mod linux;
54

65
#[cfg(any(target_os = "android", target_os = "linux"))]
@@ -13,7 +12,6 @@ pub use self::linux::*;
1312
target_os = "netbsd",
1413
target_os = "openbsd"
1514
))]
16-
#[cfg_attr(docsrs, doc(cfg(all())))]
1715
mod bsd;
1816

1917
#[cfg(any(

src/mqueue.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,9 @@ pub struct MqdT(mqd_t);
8888
// See https://sourceware.org/bugzilla/show_bug.cgi?id=21279
8989
/// Size of a message queue attribute member
9090
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
91-
#[cfg_attr(docsrs, doc(cfg(all())))]
9291
pub type mq_attr_member_t = i64;
9392
/// Size of a message queue attribute member
9493
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
95-
#[cfg_attr(docsrs, doc(cfg(all())))]
9694
pub type mq_attr_member_t = libc::c_long;
9795

9896
impl MqAttr {

0 commit comments

Comments
 (0)