Replace (Body, DefId) with Body where possible#77552
Merged
bors merged 5 commits intorust-lang:masterfrom Oct 5, 2020
Merged
Conversation
Contributor
|
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
r? @lcnr (if you have the time) |
ecstatic-morse
commented
Oct 4, 2020
Contributor
Author
There was a problem hiding this comment.
This line was incorrect. It should be checking the callee, not the caller. Really, it should just be removed entirely, since panicking in a const-context is still unstable and there's no need to promote diverging function calls.
A `Body` now contains its `MirSource`, which in turn contains the `DefId` of the item associated with the `Body`.
bd374d5 to
52484c5
Compare
lcnr
reviewed
Oct 4, 2020
Contributor
lcnr
left a comment
There was a problem hiding this comment.
fn do_mir_borrowck still takes a def
lcnr
approved these changes
Oct 5, 2020
Contributor
lcnr
left a comment
There was a problem hiding this comment.
That's a rather big improvement imo 👍
Contributor
|
Thanks, might be prone to merge conflicts @bors r+ rollup=iffy |
Collaborator
|
📌 Commit 04a94ab has been approved by |
Collaborator
Collaborator
|
☀️ Test successful - checks-actions, checks-azure |
This was referenced Oct 5, 2020
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.
Follow-up to #77430.
I
grep-ed for parameter lists in which aBodyappeared within a few lines of aDefId, so it's possible that I missed some cases, but this should be pretty complete. Most of these changes were mechanical, but there's a few places where I started calling things "caller" and "callee" when multipleDefIds were in-scope at once. Also, we should probably have a helper function onBodythat returns aLocalDefId. I can do that in this PR or in a follow-up.