-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc: use more correct span data in for loop desugaring #88214
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
rustc: use more correct span data in for loop desugaring #88214
Conversation
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
31d6b0a
to
d138326
Compare
This comment has been minimized.
This comment has been minimized.
On one hand this looks like a nice improvement in that we no longer suggest non-sense, but on the other adding a semicolon there won't help either way (and the message sounds quite confident it would help…) Please squash. r=me. |
e665aa4
to
4b3bcb7
Compare
@nagisa okay, it's squashed |
@bors r+ |
📌 Commit 4b3bcb72a81c3bc8519366d071dc9a06e8ef2174 has been approved by |
⌛ Testing commit 4b3bcb72a81c3bc8519366d071dc9a06e8ef2174 with merge 0edc41c7315527e739aca1cb018d2459dee61abe... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
4b3bcb7
to
b0a9a42
Compare
I guess I'll rebase onto the master branch? I'm not actually sure what's wrong here: after locally rebasing and running with --bless, it didn't change the output. |
Did you re-generate the
|
b0a9a42
to
0b451b8
Compare
Yes, I tried to regenerate it and nothing happened. |
@bors r+ Lets try it again, then. |
📌 Commit 0b451b8c57fa6fdbe6ef460a1362bf1cfed70d5d has been approved by |
@bors rollup=never |
Okay, so it's not my local install. Why are optimizations impacting the format of error output? |
Hm, since this error is generated by borrowck, it could be that we inadvertently run some MIR pass before borrowck that we don't run in non-optimized builds? (You could verify with |
Before: help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped | LL | for x in DroppingSlice(&*v).iter(); { | + After: help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped | LL | }; | + This seems like a reasonable fix: since the desugared "expr_drop_temps_mut" contains the entire desugared loop construct, its span should contain the entire loop construct as well.
Found it. It's actually caused by I've added a second stderr file for this. |
579e937
to
fe1a7f7
Compare
@bors r+ |
📌 Commit fe1a7f7 has been approved by |
⌛ Testing commit fe1a7f7 with merge f6f0cf7d2042b00d9eb2bf23a3c4b89afd3e7073... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
Adapts clippy for fe1a7f7
@nagisa New commit to fix the broken Clippy lints. |
@bors r+ |
📌 Commit 543e601 has been approved by |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4e880f8): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
…p-temps-mut, r=nagisa rustc: use more correct span data in for loop desugaring Fixes rust-lang#82462 Before: help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped | LL | for x in DroppingSlice(&*v).iter(); { | + After: help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped | LL | }; | + This seems like a reasonable fix: since the desugared "expr_drop_temps_mut" contains the entire desugared loop construct, its span should contain the entire loop construct as well.
Fixes #82462
Before:
After:
This seems like a reasonable fix: since the desugared "expr_drop_temps_mut" contains the entire desugared loop construct, its span should contain the entire loop construct as well.