@@ -56,6 +56,7 @@ pub enum Node<'hir> {
5656 NodeBinding ( & ' hir Pat ) ,
5757 NodePat ( & ' hir Pat ) ,
5858 NodeBlock ( & ' hir Block ) ,
59+ NodeLocal ( & ' hir Local ) ,
5960
6061 /// NodeStructCtor represents a tuple struct.
6162 NodeStructCtor ( & ' hir VariantData ) ,
@@ -90,6 +91,7 @@ enum MapEntry<'hir> {
9091 EntryLifetime ( NodeId , & ' hir Lifetime ) ,
9192 EntryTyParam ( NodeId , & ' hir TyParam ) ,
9293 EntryVisibility ( NodeId , & ' hir Visibility ) ,
94+ EntryLocal ( NodeId , & ' hir Local ) ,
9395
9496 /// Roots for node trees.
9597 RootCrate ,
@@ -121,6 +123,7 @@ impl<'hir> MapEntry<'hir> {
121123 NodeLifetime ( n) => EntryLifetime ( p, n) ,
122124 NodeTyParam ( n) => EntryTyParam ( p, n) ,
123125 NodeVisibility ( n) => EntryVisibility ( p, n) ,
126+ NodeLocal ( n) => EntryLocal ( p, n) ,
124127 }
125128 }
126129
@@ -143,6 +146,7 @@ impl<'hir> MapEntry<'hir> {
143146 EntryLifetime ( id, _) => id,
144147 EntryTyParam ( id, _) => id,
145148 EntryVisibility ( id, _) => id,
149+ EntryLocal ( id, _) => id,
146150
147151 NotPresent |
148152 RootCrate => return None ,
@@ -168,6 +172,7 @@ impl<'hir> MapEntry<'hir> {
168172 EntryLifetime ( _, n) => NodeLifetime ( n) ,
169173 EntryTyParam ( _, n) => NodeTyParam ( n) ,
170174 EntryVisibility ( _, n) => NodeVisibility ( n) ,
175+ EntryLocal ( _, n) => NodeLocal ( n) ,
171176 _ => return None
172177 } )
173178 }
@@ -325,7 +330,8 @@ impl<'hir> Map<'hir> {
325330 EntryStructCtor ( p, _) |
326331 EntryLifetime ( p, _) |
327332 EntryTyParam ( p, _) |
328- EntryVisibility ( p, _) =>
333+ EntryVisibility ( p, _) |
334+ EntryLocal ( p, _) =>
329335 id = p,
330336
331337 EntryExpr ( p, _) => {
@@ -923,6 +929,7 @@ impl<'hir> Map<'hir> {
923929 Some ( EntryTyParam ( _, ty_param) ) => ty_param. span ,
924930 Some ( EntryVisibility ( _, & Visibility :: Restricted { ref path, .. } ) ) => path. span ,
925931 Some ( EntryVisibility ( _, v) ) => bug ! ( "unexpected Visibility {:?}" , v) ,
932+ Some ( EntryLocal ( _, local) ) => local. span ,
926933
927934 Some ( RootCrate ) => self . forest . krate . span ,
928935 Some ( NotPresent ) | None => {
@@ -1131,6 +1138,7 @@ impl<'a> print::State<'a> {
11311138 // hir_map to reconstruct their full structure for pretty
11321139 // printing.
11331140 NodeStructCtor ( _) => bug ! ( "cannot print isolated StructCtor" ) ,
1141+ NodeLocal ( a) => self . print_local_decl ( & a) ,
11341142 }
11351143 }
11361144}
@@ -1232,6 +1240,9 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
12321240 Some ( NodeBlock ( _) ) => {
12331241 format ! ( "block {}{}" , map. node_to_pretty_string( id) , id_str)
12341242 }
1243+ Some ( NodeLocal ( _) ) => {
1244+ format ! ( "local {}{}" , map. node_to_pretty_string( id) , id_str)
1245+ }
12351246 Some ( NodeStructCtor ( _) ) => {
12361247 format ! ( "struct_ctor {}{}" , path_str( ) , id_str)
12371248 }
0 commit comments