@@ -204,7 +204,7 @@ impl<'hir> Map<'hir> {
204204 if let Some ( entry) = self . map [ id. as_usize ( ) ] {
205205 self . dep_graph . read_index ( entry. dep_node ) ;
206206 } else {
207- bug ! ( "called `HirMap::read()` with invalid `NodeId`" )
207+ bug ! ( "called `HirMap::read()` with invalid `NodeId`: {:?}" , id )
208208 }
209209 }
210210
@@ -344,6 +344,7 @@ impl<'hir> Map<'hir> {
344344 Node :: AnonConst ( _) |
345345 Node :: Expr ( _) |
346346 Node :: Stmt ( _) |
347+ Node :: PathSegment ( _) |
347348 Node :: Ty ( _) |
348349 Node :: TraitRef ( _) |
349350 Node :: Pat ( _) |
@@ -884,6 +885,7 @@ impl<'hir> Map<'hir> {
884885 Some ( Node :: AnonConst ( constant) ) => self . body ( constant. body ) . value . span ,
885886 Some ( Node :: Expr ( expr) ) => expr. span ,
886887 Some ( Node :: Stmt ( stmt) ) => stmt. span ,
888+ Some ( Node :: PathSegment ( seg) ) => seg. ident . span ,
887889 Some ( Node :: Ty ( ty) ) => ty. span ,
888890 Some ( Node :: TraitRef ( tr) ) => tr. path . span ,
889891 Some ( Node :: Binding ( pat) ) => pat. span ,
@@ -1098,6 +1100,7 @@ impl<'a> print::State<'a> {
10981100 Node :: AnonConst ( a) => self . print_anon_const ( & a) ,
10991101 Node :: Expr ( a) => self . print_expr ( & a) ,
11001102 Node :: Stmt ( a) => self . print_stmt ( & a) ,
1103+ Node :: PathSegment ( _) => bug ! ( "cannot print PathSegment" ) ,
11011104 Node :: Ty ( a) => self . print_type ( & a) ,
11021105 Node :: TraitRef ( a) => self . print_trait_ref ( & a) ,
11031106 Node :: Binding ( a) |
@@ -1215,6 +1218,9 @@ fn node_id_to_string(map: &Map<'_>, id: NodeId, include_id: bool) -> String {
12151218 Some ( Node :: Stmt ( _) ) => {
12161219 format ! ( "stmt {}{}" , map. node_to_pretty_string( id) , id_str)
12171220 }
1221+ Some ( Node :: PathSegment ( _) ) => {
1222+ format ! ( "path segment {}{}" , map. node_to_pretty_string( id) , id_str)
1223+ }
12181224 Some ( Node :: Ty ( _) ) => {
12191225 format ! ( "type {}{}" , map. node_to_pretty_string( id) , id_str)
12201226 }
0 commit comments