Skip to content

Improve hir::map::Map::get_parent_node doc #43605

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

Merged
merged 1 commit into from
Aug 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/librustc/hir/map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,9 @@ impl<'hir> Map<'hir> {
}

/// Similar to get_parent, returns the parent node id or id if there is no
/// parent.
/// parent. Note that the parent may be CRATE_NODE_ID, which is not itself
/// present in the map -- so passing the return value of get_parent_node to
/// get may actually panic.
/// This function returns the immediate parent in the AST, whereas get_parent
/// returns the enclosing item. Note that this might not be the actual parent
/// node in the AST - some kinds of nodes are not in the map and these will
Expand Down Expand Up @@ -629,7 +631,7 @@ impl<'hir> Map<'hir> {
}

/// Retrieve the NodeId for `id`'s enclosing method, unless there's a
/// `while` or `loop` before reacing it, as block tail returns are not
/// `while` or `loop` before reaching it, as block tail returns are not
/// available in them.
///
/// ```
Expand Down