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

incr.comp.: Avoid creating an edge to DepNode::Krate when generating debuginfo namespaces. #38243

Merged

Conversation

michaelwoerister
Copy link
Member

@michaelwoerister michaelwoerister commented Dec 8, 2016

// implementation reasons it is not possible to access this
// information without introducing a dep-tracking edge to
// DepNode::Krate, which essentially breaks incr. comp.
(ccx.tcx().crate_name(def_id.krate).as_str(), DUMMY_SP)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. I guess you decided that doing the refactoring to break out the span was too difficult? Seems like we could add a ccx.tcx().map.crate_span() helper that just ignores the read-edge easily enough as well, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

The refactoring turned out to break many implicit assumptions that there is no real root module, especially around DefPaths and HIR map parent relationships. I could give it another try but I'd estimate that it would take me several days to get this right.

Do you have a suggestion where to point the edge alternatively? I'd rather not just ignore it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well I would point it at DepNode::Hir(CRATE_DEF_ID), I think.

Note that DepNode::Krate and the Hir node for the crate def-id are distinct nodes.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 12, 2016

📌 Commit 271fb22 has been approved by nikomatsakis

@michaelwoerister
Copy link
Member Author

Pushed a cleaner fix for this. Reading a the crate's span or attribute will now add an edge to DepNode::Hir(CRATE_DEF_INDEX) instead of to the all encompassing DepNode::Krate.

@bors
Copy link
Contributor

bors commented Dec 12, 2016

⌛ Testing commit 271fb22 with merge 6483bdd...

bors added a commit that referenced this pull request Dec 12, 2016
… r=nikomatsakis

incr.comp.: Avoid creating an edge to DepNode::Krate when generating debuginfo namespaces.

r? @nikomatsakis

Fixes #38222
@bors bors merged commit 271fb22 into rust-lang:master Dec 12, 2016
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.

3 participants