@@ -56,6 +56,7 @@ pub enum Node<'hir> {
56
56
NodeBinding ( & ' hir Pat ) ,
57
57
NodePat ( & ' hir Pat ) ,
58
58
NodeBlock ( & ' hir Block ) ,
59
+ NodeLocal ( & ' hir Local ) ,
59
60
60
61
/// NodeStructCtor represents a tuple struct.
61
62
NodeStructCtor ( & ' hir VariantData ) ,
@@ -90,6 +91,7 @@ enum MapEntry<'hir> {
90
91
EntryLifetime ( NodeId , & ' hir Lifetime ) ,
91
92
EntryTyParam ( NodeId , & ' hir TyParam ) ,
92
93
EntryVisibility ( NodeId , & ' hir Visibility ) ,
94
+ EntryLocal ( NodeId , & ' hir Local ) ,
93
95
94
96
/// Roots for node trees.
95
97
RootCrate ,
@@ -121,6 +123,7 @@ impl<'hir> MapEntry<'hir> {
121
123
NodeLifetime ( n) => EntryLifetime ( p, n) ,
122
124
NodeTyParam ( n) => EntryTyParam ( p, n) ,
123
125
NodeVisibility ( n) => EntryVisibility ( p, n) ,
126
+ NodeLocal ( n) => EntryLocal ( p, n) ,
124
127
}
125
128
}
126
129
@@ -143,6 +146,7 @@ impl<'hir> MapEntry<'hir> {
143
146
EntryLifetime ( id, _) => id,
144
147
EntryTyParam ( id, _) => id,
145
148
EntryVisibility ( id, _) => id,
149
+ EntryLocal ( id, _) => id,
146
150
147
151
NotPresent |
148
152
RootCrate => return None ,
@@ -168,6 +172,7 @@ impl<'hir> MapEntry<'hir> {
168
172
EntryLifetime ( _, n) => NodeLifetime ( n) ,
169
173
EntryTyParam ( _, n) => NodeTyParam ( n) ,
170
174
EntryVisibility ( _, n) => NodeVisibility ( n) ,
175
+ EntryLocal ( _, n) => NodeLocal ( n) ,
171
176
_ => return None
172
177
} )
173
178
}
@@ -325,7 +330,8 @@ impl<'hir> Map<'hir> {
325
330
EntryStructCtor ( p, _) |
326
331
EntryLifetime ( p, _) |
327
332
EntryTyParam ( p, _) |
328
- EntryVisibility ( p, _) =>
333
+ EntryVisibility ( p, _) |
334
+ EntryLocal ( p, _) =>
329
335
id = p,
330
336
331
337
EntryExpr ( p, _) => {
@@ -923,6 +929,7 @@ impl<'hir> Map<'hir> {
923
929
Some ( EntryTyParam ( _, ty_param) ) => ty_param. span ,
924
930
Some ( EntryVisibility ( _, & Visibility :: Restricted { ref path, .. } ) ) => path. span ,
925
931
Some ( EntryVisibility ( _, v) ) => bug ! ( "unexpected Visibility {:?}" , v) ,
932
+ Some ( EntryLocal ( _, local) ) => local. span ,
926
933
927
934
Some ( RootCrate ) => self . forest . krate . span ,
928
935
Some ( NotPresent ) | None => {
@@ -1131,6 +1138,7 @@ impl<'a> print::State<'a> {
1131
1138
// hir_map to reconstruct their full structure for pretty
1132
1139
// printing.
1133
1140
NodeStructCtor ( _) => bug ! ( "cannot print isolated StructCtor" ) ,
1141
+ NodeLocal ( a) => self . print_local_decl ( & a) ,
1134
1142
}
1135
1143
}
1136
1144
}
@@ -1232,6 +1240,9 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
1232
1240
Some ( NodeBlock ( _) ) => {
1233
1241
format ! ( "block {}{}" , map. node_to_pretty_string( id) , id_str)
1234
1242
}
1243
+ Some ( NodeLocal ( _) ) => {
1244
+ format ! ( "local {}{}" , map. node_to_pretty_string( id) , id_str)
1245
+ }
1235
1246
Some ( NodeStructCtor ( _) ) => {
1236
1247
format ! ( "struct_ctor {}{}" , path_str( ) , id_str)
1237
1248
}
0 commit comments