Skip to content
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

Fix spurious 'value moved here in previous iteration of loop' messages #73600

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

Aaron1011
Copy link
Member

Fixes #46099

Previously, we would check the 'move' and 'use' spans to see if we
should emit this message. However, this can give false positives when
macros are involved, since two distinct expressions may end up with the
same span.

Instead, we check the actual MIR Location, which eliminates false
positives.

Fixes rust-lang#46099

Previously, we would check the 'move' and 'use' spans to see if we
should emit this message. However, this can give false positives when
macros are involved, since two distinct expressions may end up with the
same span.

Instead, we check the actual MIR `Location`, which eliminates false
positives.
@rust-highfive
Copy link
Collaborator

r? @ecstatic-morse

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 22, 2020
Comment on lines +6 to +10
LL | test!({b});
| ^
| |
| value moved here
| value used here after move
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is not formatted as

Suggested change
LL | test!({b});
| ^
| |
| value moved here
| value used here after move
LL | test!({b});
| ^ value moved here
| | value used here after move

It's outside the scope of this PR, just wondering.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure - I think that might just be how the diagnostic framework formats messages.

@ecstatic-morse
Copy link
Contributor

Nice.

@bors r+

@bors
Copy link
Contributor

bors commented Jun 22, 2020

📌 Commit 953104e has been approved by ecstatic-morse

@bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2020
@ecstatic-morse
Copy link
Contributor

@bors rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#71756 (add Windows system error codes that should map to io::ErrorKind::TimedOut)
 - rust-lang#73495 (Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits)
 - rust-lang#73575 (Fix typo in error_codes doc)
 - rust-lang#73578 (Make is_freeze and is_copy_modulo_regions take TyCtxtAt)
 - rust-lang#73586 (switch_ty is redundant)
 - rust-lang#73600 (Fix spurious 'value moved here in previous iteration of loop' messages)
 - rust-lang#73610 (Clean up E0699 explanation)

Failed merges:

r? @ghost
@bors bors merged commit b3d99cb into rust-lang:master Jun 23, 2020
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Moving in macros can produce value moved here in previous iteration of loop without any loops
6 participants