-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid BorrowMutError with RUSTC_LOG=debug #78524
Conversation
It looks like neither of these uses of @tmiasko: Could you try changing |
3af65d4
to
bd3ddff
Compare
Replacing Lock with RwLocks works as well, I tried that earlier. Shortening the borrow of source files seems like a good idea regardless, so I left those changes. |
@tmiasko: Can you add a regression test? I would use |
$ 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.
bd3ddff
to
a15e0dc
Compare
Extended rustc-rust-log.rs with an aux-build that uses RUSTC_LOG=debug during build. |
LGTM. The compiletest changes look reasonable to me, but I'd like to get someone else to sign off on them as well. cc @alexcrichton: It looks like you've reviewed compiletest changes before. |
Seem reasonable to me as well! |
@bors r+ |
📌 Commit a15e0dc has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#77334 (Reorder benches const variable) - rust-lang#77888 (Simplify a nested bool match) - rust-lang#77921 (f64: Refactor collapsible_if) - rust-lang#78523 (Revert invalid `fn` return type parsing change) - rust-lang#78524 (Avoid BorrowMutError with RUSTC_LOG=debug) - rust-lang#78545 (Make anonymous binders start at 0) - rust-lang#78554 (Improve wording of `core::ptr::drop_in_place` docs) - rust-lang#78556 (Link to pass docs from NRVO module docs) Failed merges: - rust-lang#78424 (Fix some more clippy warnings) r? `@ghost`
Fails with a
BorrowMutError
because source map files are alreadyborrowed while
features_query
attempts to format a log messagecontaining a span.
Release the borrow before the query to avoid the issue.