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

Cleanup refactoring around DefPath handling #38418

Merged
merged 11 commits into from
Dec 21, 2016

Conversation

michaelwoerister
Copy link
Member

This PR makes two big changes:

  • All DefPaths of a crate are now stored in metadata in their own table (as opposed to DefKeys as part of metadata Entrys.
  • The compiler will no longer allocate a pseudo-local DefId for inlined HIR nodes (because those are gross). Inlined HIR nodes will have a NodeId but they don't have there own DefId anymore. Turns out they were not needed anymore either. Hopefully HIR inlining will be gone completely one day but if until then we start needing to be able to map inlined NodeIds to original DefIds, we can add an additional table to metadata that allows for reconstructing this.

Overall this makes for some nice simplifications and removal of special cases.

r? @eddyb

cc @rust-lang/compiler

Copy link
Member

@eddyb eddyb left a comment

Choose a reason for hiding this comment

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

r=me with comments addressed.

collector.parent_def = Some(def);

collector
}
Copy link
Member

Choose a reason for hiding this comment

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

You forgot to remove the hir::intravisit::Visitor impl.

@@ -936,7 +940,7 @@ pub fn map_crate<'ast>(forest: &'ast mut Forest,
forest: forest,
dep_graph: forest.dep_graph.clone(),
map: RefCell::new(map),
definitions: RefCell::new(definitions),
definitions: definitions,
local_node_id_watermark: local_node_id_watermark,
local_def_id_watermark: local_def_id_watermark,
Copy link
Member

Choose a reason for hiding this comment

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

You can remove this watermark too btw.

@michaelwoerister
Copy link
Member Author

@bors r=eddyb

Thanks for the review!

@bors
Copy link
Contributor

bors commented Dec 17, 2016

📌 Commit 77e659a has been approved by eddyb

@frewsxcv
Copy link
Member

Travis found an ICE.

@eddyb
Copy link
Member

eddyb commented Dec 18, 2016

@bors r-

@michaelwoerister
Copy link
Member Author

Something seems to break in rustdoc...

@michaelwoerister
Copy link
Member Author

@bors r=eddyb

Re-reviewed.

@bors
Copy link
Contributor

bors commented Dec 19, 2016

📌 Commit 3a82b0d has been approved by eddyb

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Dec 20, 2016
…r=eddyb

Cleanup refactoring around DefPath handling

This PR makes two big changes:
* All DefPaths of a crate are now stored in metadata in their own table (as opposed to `DefKey`s as part of metadata `Entry`s.
* The compiler will no longer allocate a pseudo-local DefId for inlined HIR nodes (because those are gross). Inlined HIR nodes will have a NodeId but they don't have there own DefId anymore. Turns out they were not needed anymore either. Hopefully HIR inlining will be gone completely one day but if until then we start needing to be able to map inlined NodeIds to original DefIds, we can add an additional table to metadata that allows for reconstructing this.

Overall this makes for some nice simplifications and removal of special cases.

r? @eddyb

cc @rust-lang/compiler
bors added a commit that referenced this pull request Dec 20, 2016
@bors bors merged commit 3a82b0d into rust-lang:master Dec 21, 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.

4 participants