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

Explain move errors that occur due to method calls involving self (take two) #73708

Merged
merged 2 commits into from
Jun 28, 2020

Conversation

Aaron1011
Copy link
Member

This is a re-attempt of #72389 (which was reverted in #73594)
Instead of using ExpnKind::Desugaring to represent operators, this PR
checks the lang item directly.

@rust-highfive
Copy link
Collaborator

r? @davidtwco

(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 24, 2020
@Aaron1011 Aaron1011 changed the title Explain move errors that occur due to method calls involving `self (take two) Explain move errors that occur due to method calls involving self (take two) Jun 24, 2020
@petrochenkov petrochenkov self-assigned this Jun 25, 2020
@davidtwco davidtwco removed their assignment Jun 25, 2020
@petrochenkov
Copy link
Contributor

petrochenkov commented Jun 25, 2020

I'd like to investigate the possibility of removing lowering-time expansions entirely in some observable future, but in the meantime this looks ok.

(I didn't look at the rustc_mir parts.)

@petrochenkov
Copy link
Contributor

r? @davidtwco

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

LGTM, one question about the new diagnostic output but otherwise great.

src/test/ui/binop/binop-consume-args.stderr Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Jun 25, 2020

☔ The latest upstream changes (presumably #72559) made this pull request unmergeable. Please resolve the merge conflicts.

@Aaron1011 Aaron1011 force-pushed the feature/reland-move-fn-self-msg branch from cf4c2db to fbf1cd7 Compare June 25, 2020 20:00
@Aaron1011
Copy link
Member Author

@davidtwco: This should now be ready to merge

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 25, 2020

📌 Commit fbf1cd7790fb55de65b9d36f5cb3feadfa385046 has been approved by davidtwco

@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 25, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 26, 2020
…arth

Rollup of 14 pull requests

Successful merges:

 - rust-lang#72617 (Add a fast path for `std::thread::panicking`.)
 - rust-lang#72738 (Self contained linking option)
 - rust-lang#72770 (Implement mixed script confusable lint.)
 - rust-lang#73418 (Add unstable `core::mem::variant_count` intrinsic)
 - rust-lang#73460 (Emit line info for generator variants)
 - rust-lang#73534 (Provide suggestions for some moved value errors)
 - rust-lang#73538 (make commented examples use valid syntax, and be more consistent )
 - rust-lang#73581 (Create 0766 error code)
 - rust-lang#73619 (Document the mod keyword)
 - rust-lang#73621 (Document the mut keyword)
 - rust-lang#73648 (Document the return keyword)
 - rust-lang#73673 (Fix ptr doc warnings.)
 - rust-lang#73674 (Tweak binop errors)
 - rust-lang#73687 (Clean up E0701 explanation)

Failed merges:

 - rust-lang#73708 (Explain move errors that occur due to method calls involving `self` (take two))

r? @ghost
@bors
Copy link
Contributor

bors commented Jun 26, 2020

☔ The latest upstream changes (presumably #73746) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 26, 2020
Also, implement this query for the local crate, not just foreign crates.
@Aaron1011 Aaron1011 force-pushed the feature/reland-move-fn-self-msg branch from fbf1cd7 to d412181 Compare June 26, 2020 20:10
@Aaron1011
Copy link
Member Author

@davidtwco:I've rebased against master, and applied @jyn514's suggestion

This is a re-attempt of rust-lang#72389 (which was reverted in rust-lang#73594)
Instead of using `ExpnKind::Desugaring` to represent operators, this PR
checks the lang item directly.
@Aaron1011 Aaron1011 force-pushed the feature/reland-move-fn-self-msg branch from d412181 to fa6a61c Compare June 26, 2020 20:28
@Aaron1011 Aaron1011 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 26, 2020
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 27, 2020

📌 Commit fa6a61c has been approved by davidtwco

@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 27, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 28, 2020
…arth

Rollup of 10 pull requests

Successful merges:

 - rust-lang#72796 (MIR sanity check: validate types on assignment)
 - rust-lang#73243 (Add documentation to point to `File::open` or `OpenOptions::open` instead of `is_file` to check read/write possibility)
 - rust-lang#73525 (Prepare for LLVM 11)
 - rust-lang#73672 (Adds a clearer message for when the async keyword is missing from a f…)
 - rust-lang#73708 (Explain move errors that occur due to method calls involving `self` (take two))
 - rust-lang#73758 (improper_ctypes: fix remaining `Reveal:All`)
 - rust-lang#73763 (errors: use `-Z terminal-width` in JSON emitter)
 - rust-lang#73796 (replace more `DefId`s with `LocalDefId`)
 - rust-lang#73797 (fix typo in self-profile.md)
 - rust-lang#73809 (Add links to fs::DirEntry::metadata)

Failed merges:

r? @ghost
@bors bors merged commit b236e49 into rust-lang:master Jun 28, 2020
Aaron1011 added a commit to Aaron1011/rust that referenced this pull request Jan 8, 2021
PR rust-lang#73708 added a more detailed explanation of move errors that occur
due to a call to a method that takes `self`. This PR extends that logic
to work when a move error occurs due to a method call in the previous
iteration of a loop.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jan 11, 2021
Explain method-call move errors in loops

PR rust-lang#73708 added a more detailed explanation of move errors that occur
due to a call to a method that takes `self`. This PR extends that logic
to work when a move error occurs due to a method call in the previous
iteration of a loop.
@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.

7 participants