-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
process trait/impl items directly from the visitor callback #39000
process trait/impl items directly from the visitor callback #39000
Conversation
LGTM. I agree with |
Not as an argument against eliminating |
The whole closure situation is a bit troublesome. It'd be better to actually compute (copy, really) that information from the surrounding function's |
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 except one doc nit.
whether the node is inlined or not and do the right thing. | ||
whether the node is inlined or not and do the right thing. You can | ||
also use `tcx.map.is_inlined_def_id()` and | ||
`tcx.map.is_inlined_node_id()` to test. |
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.
None of this happens anymore, inlined bodies don't get their own local NodeId
s or DefId
s.
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.
Agreed.
Looks good to me! One nit: "Tables" is a rather generic name for the dep-node that says little about what it represents. If you can think of a more descriptive name, now would be the time to change it, I guess. |
|
The current setup processes impl/trait items while visiting the impl/trait. This means we basically have this setup: <Lots> -> TypeckItemBody(Impl) -> Tables(ImplItem{0,1,2,3}) But this was largely an artifact of the older code. By moving the processing of items into method dedicated for their use, we produce this setup: <Little> -> TypeckItemBody(ImplItem0) -> Tables(ImplItem0) ... <Little> -> TypeckItemBody(ImplItem3) -> Tables(ImplItem3)
2595ae8
to
282f7a3
Compare
@bors r+ |
📌 Commit 282f7a3 has been approved by |
⌛ Testing commit 282f7a3 with merge 2f0463a... |
…tem, r=michaelwoerister process trait/impl items directly from the visitor callback The current setup processes impl/trait items while visiting the impl/trait. This means we basically have this setup: <Lots> -> TypeckItemBody(Impl) -> Tables(ImplItem{0,1,2,3}) But this was largely an artifact of the older code. By moving the processing of items into method dedicated for their use, we produce this setup: <Little> -> TypeckItemBody(ImplItem0) -> Tables(ImplItem0) ... <Little> -> TypeckItemBody(ImplItem3) -> Tables(ImplItem3) r? @michaelwoerister Also, we might consider removing the `TypeckItemBody` node altogether and just using `Tables` as the task. `Tables` is its primary output, I imagine? That would reduce size of dep-graph somewhat. cc @eddyb -- perhaps this pattern applies elsewhere?
☀️ Test successful - status-appveyor, status-travis |
The current setup processes impl/trait items while visiting
the impl/trait. This means we basically have this setup:
But this was largely an artifact of the older code. By moving the
processing of items into method dedicated for their use, we produce this
setup:
r? @michaelwoerister
Also, we might consider removing the
TypeckItemBody
node altogether and just usingTables
as the task.Tables
is its primary output, I imagine? That would reduce size of dep-graph somewhat.cc @eddyb -- perhaps this pattern applies elsewhere?