Suggest ; or assignment to drop borrows in tail exprs#71217
Merged
bors merged 1 commit intorust-lang:masterfrom Apr 29, 2020
Merged
Suggest ; or assignment to drop borrows in tail exprs#71217bors merged 1 commit intorust-lang:masterfrom
; or assignment to drop borrows in tail exprs#71217bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
cc @pnkfelix |
This comment has been minimized.
This comment has been minimized.
82a765a to
d844802
Compare
|
r? @pnkfelix |
pnkfelix
reviewed
Apr 28, 2020
Contributor
|
r=me once the nit is addressed. |
Contributor
|
cc #46413 (I guess I was wrong, there was more to be done here. 😉 ) |
d844802 to
1488689
Compare
Address the diagnostics part of rust-lang#70844. ``` error[E0597]: `counter` does not live long enough --> $DIR/issue-54556-niconii.rs:22:20 | LL | if let Ok(_) = counter.lock() { } | ^^^^^^^------- | | | borrowed value does not live long enough | a temporary with access to the borrow is created here ... ... LL | } | - | | | `counter` dropped here while still borrowed | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::result::Result<MutexGuard<'_>, ()>` | help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped | LL | if let Ok(_) = counter.lock() { }; | ^ ```
1488689 to
2c6094e
Compare
Contributor
Author
|
@bors r=pnkfelix |
Collaborator
|
📌 Commit 2c6094e has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 29, 2020
Rollup of 5 pull requests Successful merges: - rust-lang#71217 (Suggest `;` or assignment to drop borrows in tail exprs) - rust-lang#71286 (Add regression test for rust-lang#69654) - rust-lang#71296 (Change wording on read_vectored docs) - rust-lang#71654 (Update link to unstable book for llvm_asm macro) - rust-lang#71657 (Add rust-lang#24949 assoc constant static recursion test) Failed merges: r? @ghost
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.
Address the diagnostics part of #70844.