Fix spurious 'value moved here in previous iteration of loop' messages#73600
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 23, 2020
Merged
Fix spurious 'value moved here in previous iteration of loop' messages#73600bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
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.
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
ayazhafiz
reviewed
Jun 22, 2020
Comment on lines
+6
to
+10
| LL | test!({b}); | ||
| | ^ | ||
| | | | ||
| | value moved here | ||
| | value used here after move |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
I'm not sure - I think that might just be how the diagnostic framework formats messages.
Contributor
|
Nice. @bors r+ |
Collaborator
|
📌 Commit 953104e has been approved by |
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
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.
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 falsepositives.