diff options
| author | bors <bors@rust-lang.org> | 2020-02-19 19:10:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-19 19:10:58 +0000 |
| commit | 7760cd0fbbbf2c59a625e075a5bdfa88b8e30f8a (patch) | |
| tree | 4f54c12a071f99e56f766983da474f3c904da61a /src/libstd | |
| parent | 7d6b8c414e84e1f4f2f40236e83125ba8e034b98 (diff) | |
| parent | a97f354767844680311da5252fe0c81ecfb9ed45 (diff) | |
| download | rust-7760cd0fbbbf2c59a625e075a5bdfa88b8e30f8a.tar.gz rust-7760cd0fbbbf2c59a625e075a5bdfa88b8e30f8a.zip | |
Auto merge of #69293 - Dylan-DPC:rollup-imcbvgo, r=Dylan-DPC
Rollup of 5 pull requests
Successful merges:
- #68863 (ci: switch macOS builders to 10.15)
- #69142 (Add shared script for linkchecking books.)
- #69248 (Don't eliminate frame pointers on thumb targets)
- #69280 (Remove special case for `simd_shuffle` arg promotion)
- #69284 (Reword OpenOptions::{create, create_new} doc.)
Failed merges:
r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fs.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index cff7bbe5ef1..09be3f13050 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -844,10 +844,7 @@ impl OpenOptions { self } - /// Sets the option for creating a new file. - /// - /// This option indicates whether a new file will be created if the file - /// does not yet already exist. + /// Sets the option to create a new file, or open it if it already exists. /// /// In order for the file to be created, [`write`] or [`append`] access must /// be used. @@ -868,11 +865,10 @@ impl OpenOptions { self } - /// Sets the option to always create a new file. + /// Sets the option to create a new file, failing if it already exists. /// - /// This option indicates whether a new file will be created. - /// No file is allowed to exist at the target location, also no (dangling) - /// symlink. + /// No file is allowed to exist at the target location, also no (dangling) symlink. In this + /// way, if the call succeeds, the file returned is guaranteed to be new. /// /// This option is useful because it is atomic. Otherwise between checking /// whether a file exists and creating a new one, the file may have been |
