-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Suggest ;
or assignment to drop borrows in tail exprs
#71217
Merged
Merged
Conversation
This file contains 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
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Apr 16, 2020
cc @pnkfelix |
This comment has been minimized.
This comment has been minimized.
estebank
force-pushed
the
tail-borrow-sugg
branch
from
April 20, 2020 21:06
82a765a
to
d844802
Compare
joelpalmer
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Apr 28, 2020
r? @pnkfelix |
pnkfelix
reviewed
Apr 28, 2020
r=me once the nit is addressed. |
pnkfelix
added
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Apr 28, 2020
cc #46413 (I guess I was wrong, there was more to be done here. 😉 ) |
estebank
force-pushed
the
tail-borrow-sugg
branch
from
April 29, 2020 01:46
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() { }; | ^ ```
estebank
force-pushed
the
tail-borrow-sugg
branch
from
April 29, 2020 01:47
1488689
to
2c6094e
Compare
@bors r=pnkfelix |
📌 Commit 2c6094e has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Apr 29, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.