提交 a9d075e7 编写于 作者: V varkor

Revert crate root changes

上级 6642462e
......@@ -561,7 +561,13 @@ pub fn get_generics_span(&self, id: DefId) -> Option<Span> {
/// Retrieve the Node corresponding to `id`, returning None if
/// cannot be found.
pub fn find(&self, id: NodeId) -> Option<Node<'hir>> {
let result = self.find_entry(id).map(|x| x.node);
let result = self.find_entry(id).and_then(|entry| {
if let Node::Crate = entry.node {
None
} else {
Some(entry.node)
}
});
if result.is_some() {
self.read(id);
}
......@@ -632,6 +638,9 @@ fn walk_parent_nodes<F, F2>(&self,
}
if let Some(entry) = self.find_entry(parent_node) {
if let Node::Crate = entry.node {
return Err(id);
}
if found(&entry.node) {
return Ok(parent_node);
} else if bail_early(&entry.node) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册