@@ -373,6 +373,7 @@ impl<'hir> Map<'hir> {
373
373
Node :: Pat ( _) |
374
374
Node :: Binding ( _) |
375
375
Node :: Local ( _) |
376
+ Node :: Arm ( _) |
376
377
Node :: Lifetime ( _) |
377
378
Node :: Visibility ( _) |
378
379
Node :: Block ( _) |
@@ -1000,6 +1001,7 @@ impl<'hir> Map<'hir> {
1000
1001
Some ( Node :: Field ( ref f) ) => Some ( & f. attrs [ ..] ) ,
1001
1002
Some ( Node :: Expr ( ref e) ) => Some ( & * e. attrs ) ,
1002
1003
Some ( Node :: Stmt ( ref s) ) => Some ( s. node . attrs ( ) ) ,
1004
+ Some ( Node :: Arm ( ref a) ) => Some ( & * a. attrs ) ,
1003
1005
Some ( Node :: GenericParam ( param) ) => Some ( & param. attrs [ ..] ) ,
1004
1006
// Unit/tuple structs/variants take the attributes straight from
1005
1007
// the struct/variant definition.
@@ -1073,6 +1075,7 @@ impl<'hir> Map<'hir> {
1073
1075
Some ( Node :: TraitRef ( tr) ) => tr. path . span ,
1074
1076
Some ( Node :: Binding ( pat) ) => pat. span ,
1075
1077
Some ( Node :: Pat ( pat) ) => pat. span ,
1078
+ Some ( Node :: Arm ( arm) ) => arm. span ,
1076
1079
Some ( Node :: Block ( block) ) => block. span ,
1077
1080
Some ( Node :: Ctor ( ..) ) => match self . find_by_hir_id (
1078
1081
self . get_parent_node_by_hir_id ( hir_id) )
@@ -1288,6 +1291,7 @@ impl<'a> print::State<'a> {
1288
1291
Node :: TraitRef ( a) => self . print_trait_ref ( & a) ,
1289
1292
Node :: Binding ( a) |
1290
1293
Node :: Pat ( a) => self . print_pat ( & a) ,
1294
+ Node :: Arm ( a) => self . print_arm ( & a) ,
1291
1295
Node :: Block ( a) => {
1292
1296
use syntax:: print:: pprust:: PrintState ;
1293
1297
@@ -1417,6 +1421,9 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
1417
1421
Some ( Node :: Pat ( _) ) => {
1418
1422
format ! ( "pat {}{}" , map. hir_to_pretty_string( id) , id_str)
1419
1423
}
1424
+ Some ( Node :: Arm ( _) ) => {
1425
+ format ! ( "arm {}{}" , map. hir_to_pretty_string( id) , id_str)
1426
+ }
1420
1427
Some ( Node :: Block ( _) ) => {
1421
1428
format ! ( "block {}{}" , map. hir_to_pretty_string( id) , id_str)
1422
1429
}
0 commit comments