1
Fork 0

change NodeId to HirId in some HIR docs

This commit is contained in:
ljedrz 2019-06-16 17:44:19 +02:00
parent 88961b049e
commit 72bb5c7067
2 changed files with 7 additions and 7 deletions

View file

@ -35,7 +35,7 @@ mod def_collector;
pub mod definitions; pub mod definitions;
mod hir_id_validator; mod hir_id_validator;
/// Represents an entry and its parent `NodeId`. /// Represents an entry and its parent `HirId`.
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
pub struct Entry<'hir> { pub struct Entry<'hir> {
parent: HirId, parent: HirId,
@ -200,7 +200,7 @@ impl<'hir> Map<'hir> {
/// "reveals" the content of a node to the caller (who might not /// "reveals" the content of a node to the caller (who might not
/// otherwise have had access to those contents, and hence needs a /// otherwise have had access to those contents, and hence needs a
/// read recorded). If the function just returns a DefId or /// read recorded). If the function just returns a DefId or
/// NodeId, no actual content was returned, so no read is needed. /// HirId, no actual content was returned, so no read is needed.
pub fn read(&self, hir_id: HirId) { pub fn read(&self, hir_id: HirId) {
if let Some(entry) = self.lookup(hir_id) { if let Some(entry) = self.lookup(hir_id) {
self.dep_graph.read_index(entry.dep_node); self.dep_graph.read_index(entry.dep_node);
@ -681,7 +681,7 @@ impl<'hir> Map<'hir> {
/// If there is some error when walking the parents (e.g., a node does not /// If there is some error when walking the parents (e.g., a node does not
/// have a parent in the map or a node can't be found), then we return the /// have a parent in the map or a node can't be found), then we return the
/// last good `NodeId` we found. Note that reaching the crate root (`id == 0`), /// last good `HirId` we found. Note that reaching the crate root (`id == 0`),
/// is not an error, since items in the crate module have the crate root as /// is not an error, since items in the crate module have the crate root as
/// parent. /// parent.
fn walk_parent_nodes<F, F2>(&self, fn walk_parent_nodes<F, F2>(&self,
@ -717,7 +717,7 @@ impl<'hir> Map<'hir> {
} }
} }
/// Retrieves the `NodeId` for `id`'s enclosing method, unless there's a /// Retrieves the `HirId` for `id`'s enclosing method, unless there's a
/// `while` or `loop` before reaching it, as block tail returns are not /// `while` or `loop` before reaching it, as block tail returns are not
/// available in them. /// available in them.
/// ///
@ -725,7 +725,7 @@ impl<'hir> Map<'hir> {
/// fn foo(x: usize) -> bool { /// fn foo(x: usize) -> bool {
/// if x == 1 { /// if x == 1 {
/// true // `get_return_block` gets passed the `id` corresponding /// true // `get_return_block` gets passed the `id` corresponding
/// } else { // to this, it will return `foo`'s `NodeId`. /// } else { // to this, it will return `foo`'s `HirId`.
/// false /// false
/// } /// }
/// } /// }

View file

@ -2177,8 +2177,8 @@ pub enum UseKind {
/// References to traits in impls. /// References to traits in impls.
/// ///
/// `resolve` maps each `TraitRef`'s `ref_id` to its defining trait; that's all /// `resolve` maps each `TraitRef`'s `ref_id` to its defining trait; that's all
/// that the `ref_id` is for. Note that `ref_id`'s value is not the `NodeId` of the /// that the `ref_id` is for. Note that `ref_id`'s value is not the `HirId` of the
/// trait being referred to but just a unique `NodeId` that serves as a key /// trait being referred to but just a unique `HirId` that serves as a key
/// within the resolution map. /// within the resolution map.
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable)] #[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable)]
pub struct TraitRef { pub struct TraitRef {