Skip to content

Commit 45204ef

Browse files
"set by Rusts options". Remove misleading always-true if cfg!(unix). Drop #![feature(rustc_private)]
1 parent 111e9bc commit 45204ef

File tree

1 file changed

+5
-7
lines changed
  • library/std/src/os/unix

1 file changed

+5
-7
lines changed

library/std/src/os/unix/fs.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,24 +408,22 @@ pub trait OpenOptionsExt {
408408
/// Pass custom flags to the `flags` argument of `open`.
409409
///
410410
/// The bits that define the access mode are masked out with `O_ACCMODE`, to
411-
/// ensure they do not interfere with the access mode set by Rusts options.
411+
/// ensure they do not interfere with the access mode set by Rust's options.
412412
///
413-
/// Custom flags can only set flags, not remove flags set by Rusts options.
414-
/// This options overwrites any previously set custom flags.
413+
/// Custom flags can only set flags, not remove flags set by Rust's options.
414+
/// This function overwrites any previously-set custom flags.
415415
///
416416
/// # Examples
417417
///
418418
/// ```no_run
419-
/// # #![feature(rustc_private)]
419+
/// # mod libc { pub const O_NOFOLLOW: i32 = 0; }
420420
/// use std::fs::OpenOptions;
421421
/// use std::os::unix::fs::OpenOptionsExt;
422422
///
423423
/// # fn main() {
424424
/// let mut options = OpenOptions::new();
425425
/// options.write(true);
426-
/// if cfg!(unix) {
427-
/// options.custom_flags(libc::O_NOFOLLOW);
428-
/// }
426+
/// options.custom_flags(libc::O_NOFOLLOW);
429427
/// let file = options.open("foo.txt");
430428
/// # }
431429
/// ```

0 commit comments

Comments
 (0)