diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-23 23:22:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-23 23:22:38 +0100 |
| commit | 0bb06cbea920d9a314071c0c2446ffa49055292e (patch) | |
| tree | e17954756dc562ceced49740a499a576dd8b4884 /src/librustdoc/html | |
| parent | 8ad3b5ccca7d2006997c1252bf4db35593143459 (diff) | |
| parent | 05ef20f92203b273d5019cce5ed7907a87420c6a (diff) | |
| download | rust-0bb06cbea920d9a314071c0c2446ffa49055292e.tar.gz rust-0bb06cbea920d9a314071c0c2446ffa49055292e.zip | |
Rollup merge of #66657 - ollie27:rustdoc_flock_panic, r=GuillaumeGomez
rustdoc: Don't panic when failing to write .lock file It can be treated like any other unexpected IO error. I couldn't think of a good way to add a test for this unfortunately. r? @GuillaumeGomez
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/render.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index ba481655bec..ba94cb82c00 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -546,7 +546,8 @@ fn write_shared( // Write out the shared files. Note that these are shared among all rustdoc // docs placed in the output directory, so this needs to be a synchronized // operation with respect to all other rustdocs running around. - let _lock = flock::Lock::panicking_new(&cx.dst.join(".lock"), true, true, true); + let lock_file = cx.dst.join(".lock"); + let _lock = try_err!(flock::Lock::new(&lock_file, true, true, true), &lock_file); // Add all the static files. These may already exist, but we just // overwrite them anyway to make sure that they're fresh and up-to-date. |
