@@ -204,7 +204,7 @@ impl<'hir> Map<'hir> {
204
204
if let Some ( entry) = self . map [ id. as_usize ( ) ] {
205
205
self . dep_graph . read_index ( entry. dep_node ) ;
206
206
} else {
207
- bug ! ( "called `HirMap::read()` with invalid `NodeId`" )
207
+ bug ! ( "called `HirMap::read()` with invalid `NodeId`: {:?}" , id )
208
208
}
209
209
}
210
210
@@ -344,6 +344,7 @@ impl<'hir> Map<'hir> {
344
344
Node :: AnonConst ( _) |
345
345
Node :: Expr ( _) |
346
346
Node :: Stmt ( _) |
347
+ Node :: PathSegment ( _) |
347
348
Node :: Ty ( _) |
348
349
Node :: TraitRef ( _) |
349
350
Node :: Pat ( _) |
@@ -884,6 +885,7 @@ impl<'hir> Map<'hir> {
884
885
Some ( Node :: AnonConst ( constant) ) => self . body ( constant. body ) . value . span ,
885
886
Some ( Node :: Expr ( expr) ) => expr. span ,
886
887
Some ( Node :: Stmt ( stmt) ) => stmt. span ,
888
+ Some ( Node :: PathSegment ( seg) ) => seg. ident . span ,
887
889
Some ( Node :: Ty ( ty) ) => ty. span ,
888
890
Some ( Node :: TraitRef ( tr) ) => tr. path . span ,
889
891
Some ( Node :: Binding ( pat) ) => pat. span ,
@@ -1098,6 +1100,7 @@ impl<'a> print::State<'a> {
1098
1100
Node :: AnonConst ( a) => self . print_anon_const ( & a) ,
1099
1101
Node :: Expr ( a) => self . print_expr ( & a) ,
1100
1102
Node :: Stmt ( a) => self . print_stmt ( & a) ,
1103
+ Node :: PathSegment ( _) => bug ! ( "cannot print PathSegment" ) ,
1101
1104
Node :: Ty ( a) => self . print_type ( & a) ,
1102
1105
Node :: TraitRef ( a) => self . print_trait_ref ( & a) ,
1103
1106
Node :: Binding ( a) |
@@ -1215,6 +1218,9 @@ fn node_id_to_string(map: &Map<'_>, id: NodeId, include_id: bool) -> String {
1215
1218
Some ( Node :: Stmt ( _) ) => {
1216
1219
format ! ( "stmt {}{}" , map. node_to_pretty_string( id) , id_str)
1217
1220
}
1221
+ Some ( Node :: PathSegment ( _) ) => {
1222
+ format ! ( "path segment {}{}" , map. node_to_pretty_string( id) , id_str)
1223
+ }
1218
1224
Some ( Node :: Ty ( _) ) => {
1219
1225
format ! ( "type {}{}" , map. node_to_pretty_string( id) , id_str)
1220
1226
}
0 commit comments