Skip to content

Fix dep graph edges around the fulfillment cache in the tcx #31087

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

Merged
merged 3 commits into from
Jan 22, 2016

Conversation

nikomatsakis
Copy link
Contributor

This is a fix for #30741. It simplifies dep-graph tracking for trait matching. I was experimenting with having a greater resolution here, but decided to pare back to just have one dep node for "trait resolutions on trait Foo", which means that adding an impl to the trait Foo will invalidate all fns that had to do any trait matching at all on Foo. This seems like a reasonable starting place.

Independently, I realized I had neglected to record a dependency from trans on typeck -- this is obviously needed, since trans consumes a bunch of data structures that typeck produces (but which are not currently individually tracked) -- and because trans assumes that typeck has been done. Eventually those are going to go away and be replaced with MIR, which will be tracked, so this edge would presumably be derived automatically then, but it's an obvious enough thing to want for now.

r? @arielb1

cc @michaelwoerister -- this might indirectly fix the problem you observed with the trans cache, though it'd be nice to try and craft an independent test case for that.

size of `DepNode` smaller and because we are not that fine-grained yet
anyhow
was the major use-case, and to update the dep-graph. Other kinds of
predicates are now excluded from the cache because there is no easy way
to make a good dep-graph node for them, and because they are not
believed to be that useful. :)

Fixes rust-lang#30741. (However, the test still gives wrong result for trans,
for an independent reason which is fixed in the next commit.)
@arielb1
Copy link
Contributor

arielb1 commented Jan 21, 2016

Nice way to introduce me to depgraph!

@arielb1
Copy link
Contributor

arielb1 commented Jan 21, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 21, 2016

📌 Commit 56c73e5 has been approved by arielb1

@bors
Copy link
Collaborator

bors commented Jan 22, 2016

⌛ Testing commit 56c73e5 with merge 8f36038...

bors added a commit that referenced this pull request Jan 22, 2016
…ielb1

This is a fix for #30741. It simplifies dep-graph tracking for trait matching. I was experimenting with having a greater resolution here, but decided to pare back to just have one dep node for "trait resolutions on trait `Foo`", which means that adding an impl to the trait `Foo` will invalidate all fns that had to do any trait matching at all on `Foo`. This seems like a reasonable starting place.

Independently, I realized I had neglected to record a dependency from trans on typeck -- this is obviously needed, since trans consumes a bunch of data structures that typeck produces (but which are not currently individually tracked) -- and because trans assumes that typeck has been done. Eventually those are going to go away and be replaced with MIR, which will be tracked, so this edge would presumably be derived automatically then, but it's an obvious enough thing to want for now.

r? @arielb1

cc @michaelwoerister -- this might indirectly fix the problem you observed with the trans cache, though it'd be nice to try and craft an independent test case for that.
@jonas-schievink
Copy link
Contributor

Could this be used to lint on unused trait impls?

@bors bors merged commit 56c73e5 into rust-lang:master Jan 22, 2016
@nikomatsakis
Copy link
Contributor Author

@jonas-schievink

Could this be used to lint on unused trait impls?

Not with much precision, at least not right now. We're just tracking what traits you looked at, not which impls.

@nikomatsakis nikomatsakis deleted the incr-comp-fulfillment-cache branch March 30, 2016 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants