-
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
Add match arm scopes and other scope fixes #60174
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try This probably should be cratered because it breaks code uses |
⌛ Trying commit 2feb6385c62f996092c3883f26918aa9af810fe4 with merge 49a98abd081547c1b12687ed2ca0de70f8d72029... |
Seems right, but cc @rust-lang/lang |
5a387e2
to
a8a9153
Compare
@matthewjasper I just rebased #56278, can you check if your PR breaks anything I want to enforce in that PR? |
@eddyb It looks like there shouldn't be any problems there. |
☔ The latest upstream changes (presumably #60224) made this pull request unmergeable. Please resolve the merge conflicts. |
a8a9153
to
a510e30
Compare
@bors try |
⌛ Trying commit a510e30ca8310916760e246847b0be13db4ce844 with merge 74092351c05ae61047b2be02024415546595e974... |
☀️ Try build successful - checks-travis |
@craterbot run start=master#e305df1846a6d985315917ae0c81b74af8b4e641 end=try#74092351c05ae61047b2be02024415546595e974 mode=check-only |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
@rust-timer build 74092351c05ae61047b2be02024415546595e974 |
Success: Queued 74092351c05ae61047b2be02024415546595e974 with parent e305df1, comparison URL. |
Finished benchmarking try commit 74092351c05ae61047b2be02024415546595e974 |
🎉 Experiment
|
a510e30
to
cba3e8e
Compare
* Don't generate an extra lint scope for each `let` statement. * Place match guards inside the visiblility scope of the bindings for their arm.
Also give arms the correct lint scope in MIR.
I was incorrectly under the impression that this would only lead to duplicates. See `mir-opt/match-arm-scope.rs` (upcomming commit) for a case where we didn't emit a fake borrow of `items.1`.
This ensures that we will correctly generate a storage-dead if the initializing expression diverges.
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
5b5255d
to
0835048
Compare
@bors r=pnkfelix |
📌 Commit 0835048 has been approved by |
⌛ Testing commit 0835048 with merge 79e50518a01ed5b42b0beb321f95c39311ae54b5... |
@bors retry Yielding priority to beta. |
⌛ Testing commit 0835048 with merge 11f75e1080e60a8130dfecf39aa89935921892cf... |
@bors retry |
⌛ Testing commit 0835048 with merge 6f77e237130fe0e7b2c73aa930f778aa9d4081cd... |
@bors retry |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Add match arm scopes and other scope fixes * Add drop and lint scopes for match arms. * Lint attributes are now respected on match arms. * Make sure we emit a StorageDead if we diverge when initializing a temporary. * Adjust MIR pretty printing of scopes for locals. * Don't generate duplicate lint scopes for `let statements`. * Add some previously missing fake borrows for matches. closes #46525 cc @rust-lang/compiler
☀️ Test successful - checks-travis, status-appveyor |
let statements
.closes #46525
cc @rust-lang/compiler