File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -553,7 +553,9 @@ impl<'hir> Map<'hir> {
553
553
}
554
554
555
555
/// Similar to get_parent, returns the parent node id or id if there is no
556
- /// parent.
556
+ /// parent. Note that the parent may be CRATE_NODE_ID, which is not itself
557
+ /// present in the map -- so passing the return value of get_parent_node to
558
+ /// get may actually panic.
557
559
/// This function returns the immediate parent in the AST, whereas get_parent
558
560
/// returns the enclosing item. Note that this might not be the actual parent
559
561
/// node in the AST - some kinds of nodes are not in the map and these will
@@ -629,7 +631,7 @@ impl<'hir> Map<'hir> {
629
631
}
630
632
631
633
/// Retrieve the NodeId for `id`'s enclosing method, unless there's a
632
- /// `while` or `loop` before reacing it, as block tail returns are not
634
+ /// `while` or `loop` before reaching it, as block tail returns are not
633
635
/// available in them.
634
636
///
635
637
/// ```
You can’t perform that action at this time.
0 commit comments