use Once instead of Mutex to manage capture resolution#80736
Merged
bors merged 1 commit intorust-lang:masterfrom Jan 13, 2021
KodrAus:feat/lazy-resolve
Merged
use Once instead of Mutex to manage capture resolution#80736bors merged 1 commit intorust-lang:masterfrom KodrAus:feat/lazy-resolve
bors merged 1 commit intorust-lang:masterfrom
KodrAus:feat/lazy-resolve
Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
KodrAus
commented
Jan 6, 2021
library/std/src/backtrace.rs
Outdated
Contributor
Author
There was a problem hiding this comment.
It's not visible in the diff, but we do have a test to ensure Backtrace is Send + Sync
This comment has been minimized.
This comment has been minimized.
This allows us to return borrows of the captured backtrace frames that are tied to a borrow of the Backtrace itself, instead of to some short-lived Mutex guard. It also makes it semantically clearer what synchronization is needed on the capture.
flub
approved these changes
Jan 7, 2021
Member
|
LGTM |
Contributor
Author
|
r? @dtolnay |
Member
|
@bors r+ |
Collaborator
|
📌 Commit db4585a has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 13, 2021
Rollup of 10 pull requests Successful merges: - rust-lang#78901 (diagnostics: Note capturing closures can't be coerced to fns) - rust-lang#79588 (Provide more information for HRTB lifetime errors involving closures) - rust-lang#80232 (Remove redundant def_id lookups) - rust-lang#80662 (Added support for i386-unknown-linux-gnu and i486-unknown-linux-gnu) - rust-lang#80736 (use Once instead of Mutex to manage capture resolution) - rust-lang#80796 (Update to LLVM 11.0.1) - rust-lang#80859 (Fix --pretty=expanded with --remap-path-prefix) - rust-lang#80922 (Revert "Auto merge of rust-lang#76896 - spastorino:codegen-inline-fns2) - rust-lang#80924 (Fix rustdoc --test-builder argument parsing) - rust-lang#80935 (Rename `rustc_middle::lint::LevelSource` to `LevelAndSource`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #78299
This allows us to return borrows of the captured backtrace frames that are tied to a borrow of the Backtrace itself, instead of to some short-lived Mutex guard.
We could alternatively share
&Mutex<Capture>s and lock on-demand, but then we could potentially forget to callresolve()before working with the capture. It also makes it semantically clearer what synchronization is needed on the capture.cc @seanchen1991 @rust-lang/project-error-handling