@@ -386,11 +386,14 @@ impl<'hir> Map<'hir> {
386386 Node :: AnonConst ( _) |
387387 Node :: StructField ( _) |
388388 Node :: Expr ( _) |
389+ Node :: Field ( _) |
389390 Node :: Stmt ( _) |
390391 Node :: PathSegment ( _) |
391392 Node :: Ty ( _) |
393+ Node :: TypeBinding ( _) |
392394 Node :: TraitRef ( _) |
393395 Node :: Pat ( _) |
396+ Node :: FieldPat ( _) |
394397 Node :: Binding ( _) |
395398 Node :: Local ( _) |
396399 Node :: Param ( _) |
@@ -1075,12 +1078,15 @@ impl<'hir> Map<'hir> {
10751078 Some ( Node :: StructField ( field) ) => field. span ,
10761079 Some ( Node :: AnonConst ( constant) ) => self . body ( constant. body ) . value . span ,
10771080 Some ( Node :: Expr ( expr) ) => expr. span ,
1081+ Some ( Node :: Field ( field) ) => field. span ,
10781082 Some ( Node :: Stmt ( stmt) ) => stmt. span ,
10791083 Some ( Node :: PathSegment ( seg) ) => seg. ident . span ,
10801084 Some ( Node :: Ty ( ty) ) => ty. span ,
1085+ Some ( Node :: TypeBinding ( type_binding) ) => type_binding. span ,
10811086 Some ( Node :: TraitRef ( tr) ) => tr. path . span ,
10821087 Some ( Node :: Binding ( pat) ) => pat. span ,
10831088 Some ( Node :: Pat ( pat) ) => pat. span ,
1089+ Some ( Node :: FieldPat ( field) ) => field. span ,
10841090 Some ( Node :: Arm ( arm) ) => arm. span ,
10851091 Some ( Node :: Block ( block) ) => block. span ,
10861092 Some ( Node :: Ctor ( ..) ) => match self . find (
@@ -1287,12 +1293,15 @@ impl<'a> print::State<'a> {
12871293 Node :: Variant ( a) => self . print_variant ( & a) ,
12881294 Node :: AnonConst ( a) => self . print_anon_const ( & a) ,
12891295 Node :: Expr ( a) => self . print_expr ( & a) ,
1296+ Node :: Field ( _) => bug ! ( "cannot print Field" ) ,
12901297 Node :: Stmt ( a) => self . print_stmt ( & a) ,
12911298 Node :: PathSegment ( a) => self . print_path_segment ( & a) ,
12921299 Node :: Ty ( a) => self . print_type ( & a) ,
1300+ Node :: TypeBinding ( _) => bug ! ( "cannot print TypeBinding" ) ,
12931301 Node :: TraitRef ( a) => self . print_trait_ref ( & a) ,
12941302 Node :: Binding ( a) |
12951303 Node :: Pat ( a) => self . print_pat ( & a) ,
1304+ Node :: FieldPat ( _) => bug ! ( "cannot print FieldPat" ) ,
12961305 Node :: Arm ( a) => self . print_arm ( & a) ,
12971306 Node :: Block ( a) => {
12981307 // Containing cbox, will be closed by print-block at `}`.
@@ -1403,6 +1412,9 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
14031412 Some ( Node :: Expr ( _) ) => {
14041413 format ! ( "expr {}{}" , map. hir_to_pretty_string( id) , id_str)
14051414 }
1415+ Some ( Node :: Field ( f) ) => {
1416+ format ! ( "field {}: {}{}" , f. ident, map. hir_to_pretty_string( f. expr. hir_id) , id_str)
1417+ }
14061418 Some ( Node :: Stmt ( _) ) => {
14071419 format ! ( "stmt {}{}" , map. hir_to_pretty_string( id) , id_str)
14081420 }
@@ -1412,6 +1424,9 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
14121424 Some ( Node :: Ty ( _) ) => {
14131425 format ! ( "type {}{}" , map. hir_to_pretty_string( id) , id_str)
14141426 }
1427+ Some ( Node :: TypeBinding ( type_binding) ) => {
1428+ format ! ( "type binding {:?}{}" , type_binding, id_str)
1429+ }
14151430 Some ( Node :: TraitRef ( _) ) => {
14161431 format ! ( "trait_ref {}{}" , map. hir_to_pretty_string( id) , id_str)
14171432 }
@@ -1421,6 +1436,9 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
14211436 Some ( Node :: Pat ( _) ) => {
14221437 format ! ( "pat {}{}" , map. hir_to_pretty_string( id) , id_str)
14231438 }
1439+ Some ( Node :: FieldPat ( f) ) => {
1440+ format ! ( "field pat {}: {}{}" , f. ident, map. hir_to_pretty_string( f. pat. hir_id) , id_str)
1441+ }
14241442 Some ( Node :: Param ( _) ) => {
14251443 format ! ( "param {}{}" , map. hir_to_pretty_string( id) , id_str)
14261444 }
0 commit comments