-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Restructure hir::map::Node and hir::map::Entry #53616
Conversation
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #53460) made this pull request unmergeable. Please resolve the merge conflicts. |
struct Entry {
parent: NodeId,
dep_node: DepNodeIndex,
node: Node,
} Add Also, since |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
All done! |
src/librustc/hir/map/collector.rs
Outdated
@@ -114,7 +114,11 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> { | |||
hcx, | |||
hir_body_nodes, | |||
}; | |||
collector.insert_entry(CRATE_NODE_ID, RootCrate(root_mod_sig_dep_index)); | |||
collector.insert_entry(CRATE_NODE_ID, Entry { | |||
parent: ast::DUMMY_NODE_ID, |
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.
I think you actually want CRATE_NODE_ID
here.
src/librustc/hir/map/mod.rs
Outdated
RootCrate(_) => return None | ||
}) | ||
match self.node { | ||
Node::Crate => None, |
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.
I don't think this is useful.
src/librustc/hir/mod.rs
Outdated
Visibility(&'hir Visibility), | ||
|
||
/// Roots for node trees. Its DepNodeIndex when in `Entry` | ||
/// is the dependency node of the crate's root module. |
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.
I don't think this is super relevant. Also, we could technically make this point to data as well, it'd just not be cleanly separated yet, so we can't do it (would break incremental).
LGTM! r? @nikomatsakis or @michaelwoerister |
This comment has been minimized.
This comment has been minimized.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@eddyb: well, it didn't like those changes. I guess excluding the crate root was important. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@varkor That just means there are bugs lurking around and they warrant further investigation. |
☔ The latest upstream changes (presumably #53640) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r+ |
📌 Commit 55c34e5c6e0a4f18e89828f6cf8e1581b8d8ed2e has been approved by |
@bors r- |
r=me post rebase =) |
src/librustc/hir/map/collector.rs
Outdated
@@ -29,7 +29,7 @@ pub(super) struct NodeCollector<'a, 'hir> { | |||
/// The crate | |||
krate: &'hir Crate, | |||
/// The node map | |||
map: Vec<EntryKind<'hir>>, | |||
map: Vec<Option<Entry<'hir>>>, |
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.
Nice
@bors r=nikomatsakis |
📌 Commit a9d075e has been approved by |
Restructure hir::map::Node and hir::map::Entry - Moves `hir::map::Node` to `hir::Node` and removes the `Node*` prefix from its variants. - Changes `hir::map::Entry` to a struct `hir::map::Entry`. - Removes the `Node*` prefix from each of `AnnNode`s variants. r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
📣 Toolstate changed by #53616! Tested on commit 59e52b1. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). |
Tested on commit rust-lang/rust@59e52b1. Direct link to PR: <rust-lang/rust#53616> 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). 💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). 💔 rls on windows: test-pass → build-fail (cc @nrc, @rust-lang/infra). 💔 rls on linux: test-pass → build-fail (cc @nrc, @rust-lang/infra).
on it wrt clippy failure |
hir::map::Node
tohir::Node
and removes theNode*
prefix from its variants.hir::map::Entry
to a structhir::map::Entry
.Node*
prefix from each ofAnnNode
s variants.r? @eddyb