@@ -386,11 +386,14 @@ impl<'hir> Map<'hir> {
386
386
Node :: AnonConst ( _) |
387
387
Node :: StructField ( _) |
388
388
Node :: Expr ( _) |
389
+ Node :: Field ( _) |
389
390
Node :: Stmt ( _) |
390
391
Node :: PathSegment ( _) |
391
392
Node :: Ty ( _) |
393
+ Node :: TypeBinding ( _) |
392
394
Node :: TraitRef ( _) |
393
395
Node :: Pat ( _) |
396
+ Node :: FieldPat ( _) |
394
397
Node :: Binding ( _) |
395
398
Node :: Local ( _) |
396
399
Node :: Param ( _) |
@@ -1075,12 +1078,15 @@ impl<'hir> Map<'hir> {
1075
1078
Some ( Node :: StructField ( field) ) => field. span ,
1076
1079
Some ( Node :: AnonConst ( constant) ) => self . body ( constant. body ) . value . span ,
1077
1080
Some ( Node :: Expr ( expr) ) => expr. span ,
1081
+ Some ( Node :: Field ( field) ) => field. span ,
1078
1082
Some ( Node :: Stmt ( stmt) ) => stmt. span ,
1079
1083
Some ( Node :: PathSegment ( seg) ) => seg. ident . span ,
1080
1084
Some ( Node :: Ty ( ty) ) => ty. span ,
1085
+ Some ( Node :: TypeBinding ( type_binding) ) => type_binding. span ,
1081
1086
Some ( Node :: TraitRef ( tr) ) => tr. path . span ,
1082
1087
Some ( Node :: Binding ( pat) ) => pat. span ,
1083
1088
Some ( Node :: Pat ( pat) ) => pat. span ,
1089
+ Some ( Node :: FieldPat ( field) ) => field. span ,
1084
1090
Some ( Node :: Arm ( arm) ) => arm. span ,
1085
1091
Some ( Node :: Block ( block) ) => block. span ,
1086
1092
Some ( Node :: Ctor ( ..) ) => match self . find (
@@ -1287,12 +1293,15 @@ impl<'a> print::State<'a> {
1287
1293
Node :: Variant ( a) => self . print_variant ( & a) ,
1288
1294
Node :: AnonConst ( a) => self . print_anon_const ( & a) ,
1289
1295
Node :: Expr ( a) => self . print_expr ( & a) ,
1296
+ Node :: Field ( _) => bug ! ( "cannot print Field" ) ,
1290
1297
Node :: Stmt ( a) => self . print_stmt ( & a) ,
1291
1298
Node :: PathSegment ( a) => self . print_path_segment ( & a) ,
1292
1299
Node :: Ty ( a) => self . print_type ( & a) ,
1300
+ Node :: TypeBinding ( _) => bug ! ( "cannot print TypeBinding" ) ,
1293
1301
Node :: TraitRef ( a) => self . print_trait_ref ( & a) ,
1294
1302
Node :: Binding ( a) |
1295
1303
Node :: Pat ( a) => self . print_pat ( & a) ,
1304
+ Node :: FieldPat ( _) => bug ! ( "cannot print FieldPat" ) ,
1296
1305
Node :: Arm ( a) => self . print_arm ( & a) ,
1297
1306
Node :: Block ( a) => {
1298
1307
// 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 {
1403
1412
Some ( Node :: Expr ( _) ) => {
1404
1413
format ! ( "expr {}{}" , map. hir_to_pretty_string( id) , id_str)
1405
1414
}
1415
+ Some ( Node :: Field ( f) ) => {
1416
+ format ! ( "field {}: {}{}" , f. ident, map. hir_to_pretty_string( f. expr. hir_id) , id_str)
1417
+ }
1406
1418
Some ( Node :: Stmt ( _) ) => {
1407
1419
format ! ( "stmt {}{}" , map. hir_to_pretty_string( id) , id_str)
1408
1420
}
@@ -1412,6 +1424,9 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
1412
1424
Some ( Node :: Ty ( _) ) => {
1413
1425
format ! ( "type {}{}" , map. hir_to_pretty_string( id) , id_str)
1414
1426
}
1427
+ Some ( Node :: TypeBinding ( type_binding) ) => {
1428
+ format ! ( "type binding {:?}{}" , type_binding, id_str)
1429
+ }
1415
1430
Some ( Node :: TraitRef ( _) ) => {
1416
1431
format ! ( "trait_ref {}{}" , map. hir_to_pretty_string( id) , id_str)
1417
1432
}
@@ -1421,6 +1436,9 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
1421
1436
Some ( Node :: Pat ( _) ) => {
1422
1437
format ! ( "pat {}{}" , map. hir_to_pretty_string( id) , id_str)
1423
1438
}
1439
+ Some ( Node :: FieldPat ( f) ) => {
1440
+ format ! ( "field pat {}: {}{}" , f. ident, map. hir_to_pretty_string( f. pat. hir_id) , id_str)
1441
+ }
1424
1442
Some ( Node :: Param ( _) ) => {
1425
1443
format ! ( "param {}{}" , map. hir_to_pretty_string( id) , id_str)
1426
1444
}
0 commit comments