1
Fork 0

Rollup merge of #78524 - tmiasko:source-files-borrow, r=Aaron1011

Avoid BorrowMutError with RUSTC_LOG=debug

```console
$ touch empty.rs
$ env RUSTC_LOG=debug rustc +stage1 --crate-type=lib empty.rs
```

Fails with a `BorrowMutError` because source map files are already
borrowed while `features_query` attempts to format a log message
containing a span.

Release the borrow before the query to avoid the issue.
This commit is contained in:
Yuki Okushi 2020-10-30 18:00:54 +09:00 committed by GitHub
commit f8539221d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 9 deletions

View file

@ -512,7 +512,7 @@ impl<T: Clone> Clone for Lock<T> {
}
}
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct RwLock<T>(InnerRwLock<T>);
impl<T> RwLock<T> {