diff options
| author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-06-22 22:15:13 +0200 |
|---|---|---|
| committer | наб <nabijaczleweli@nabijaczleweli.xyz> | 2025-06-28 17:57:57 +0200 |
| commit | 45204ef4f49fb8a51c138ded8f4912c11e468b06 (patch) | |
| tree | 3d40329e3b2c39f7ae0b4fcddb061fca7b2cfe7d | |
| parent | 111e9bc64bbdce14122e3676978f2ceefa5bff1a (diff) | |
| download | rust-45204ef4f49fb8a51c138ded8f4912c11e468b06.tar.gz rust-45204ef4f49fb8a51c138ded8f4912c11e468b06.zip | |
"set by Rusts options". Remove misleading always-true if cfg!(unix). Drop #![feature(rustc_private)]
| -rw-r--r-- | library/std/src/os/unix/fs.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/library/std/src/os/unix/fs.rs b/library/std/src/os/unix/fs.rs index 4f9259f39c1..b776df3dde1 100644 --- a/library/std/src/os/unix/fs.rs +++ b/library/std/src/os/unix/fs.rs @@ -408,24 +408,22 @@ pub trait OpenOptionsExt { /// Pass custom flags to the `flags` argument of `open`. /// /// The bits that define the access mode are masked out with `O_ACCMODE`, to - /// ensure they do not interfere with the access mode set by Rusts options. + /// ensure they do not interfere with the access mode set by Rust's options. /// - /// Custom flags can only set flags, not remove flags set by Rusts options. - /// This options overwrites any previously set custom flags. + /// Custom flags can only set flags, not remove flags set by Rust's options. + /// This function overwrites any previously-set custom flags. /// /// # Examples /// /// ```no_run - /// # #![feature(rustc_private)] + /// # mod libc { pub const O_NOFOLLOW: i32 = 0; } /// use std::fs::OpenOptions; /// use std::os::unix::fs::OpenOptionsExt; /// /// # fn main() { /// let mut options = OpenOptions::new(); /// options.write(true); - /// if cfg!(unix) { - /// options.custom_flags(libc::O_NOFOLLOW); - /// } + /// options.custom_flags(libc::O_NOFOLLOW); /// let file = options.open("foo.txt"); /// # } /// ``` |
