-
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
Explain move errors that occur due to method calls involving self
(take two)
#73708
Explain move errors that occur due to method calls involving self
(take two)
#73708
Conversation
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
self
(take two)
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.) |
r? @davidtwco |
There was a problem hiding this 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.
☔ The latest upstream changes (presumably #72559) made this pull request unmergeable. Please resolve the merge conflicts. |
cf4c2db
to
fbf1cd7
Compare
@davidtwco: This should now be ready to merge |
@bors r+ |
📌 Commit fbf1cd7790fb55de65b9d36f5cb3feadfa385046 has been approved by |
…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
☔ The latest upstream changes (presumably #73746) made this pull request unmergeable. Please resolve the merge conflicts. |
Also, implement this query for the local crate, not just foreign crates.
fbf1cd7
to
d412181
Compare
@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.
d412181
to
fa6a61c
Compare
@bors r+ |
📌 Commit fa6a61c has been approved by |
…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
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.
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.
This is a re-attempt of #72389 (which was reverted in #73594)
Instead of using
ExpnKind::Desugaring
to represent operators, this PRchecks the lang item directly.