@@ -144,14 +144,14 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
144144 format ! ( "{}unknown scope: {:?}{}. Please report a bug." ,
145145 prefix, scope, suffix)
146146 } ;
147- let span = match scope. span ( & self . region_maps , & self . map ) {
147+ let span = match scope. span ( & self . region_maps , & self . hir ) {
148148 Some ( s) => s,
149149 None => {
150150 err. note ( & unknown_scope ( ) ) ;
151151 return ;
152152 }
153153 } ;
154- let tag = match self . map . find ( scope. node_id ( & self . region_maps ) ) {
154+ let tag = match self . hir . find ( scope. node_id ( & self . region_maps ) ) {
155155 Some ( ast_map:: NodeBlock ( _) ) => "block" ,
156156 Some ( ast_map:: NodeExpr ( expr) ) => match expr. node {
157157 hir:: ExprCall ( ..) => "call" ,
@@ -206,7 +206,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
206206
207207 let node = fr. scope . node_id ( & self . region_maps ) ;
208208 let unknown;
209- let tag = match self . map . find ( node) {
209+ let tag = match self . hir . find ( node) {
210210 Some ( ast_map:: NodeBlock ( _) ) |
211211 Some ( ast_map:: NodeExpr ( _) ) => "body" ,
212212 Some ( ast_map:: NodeItem ( it) ) => item_scope_tag ( & it) ,
@@ -218,7 +218,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
218218 Some ( _) => {
219219 unknown = format ! ( "unexpected node ({}) for scope {:?}. \
220220 Please report a bug.",
221- self . map . node_to_string( node) , fr. scope) ;
221+ self . hir . node_to_string( node) , fr. scope) ;
222222 & unknown
223223 }
224224 None => {
@@ -227,7 +227,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
227227 & unknown
228228 }
229229 } ;
230- let ( msg, opt_span) = explain_span ( self , tag, self . map . span ( node) ) ;
230+ let ( msg, opt_span) = explain_span ( self , tag, self . hir . span ( node) ) ;
231231 ( format ! ( "{} {}" , prefix, msg) , opt_span)
232232 }
233233
@@ -467,8 +467,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
467467 } ,
468468 _ => return None
469469 } ;
470- let parent = tcx. map . get_parent ( scope_id) ;
471- let parent_node = tcx. map . find ( parent) ;
470+ let parent = tcx. hir . get_parent ( scope_id) ;
471+ let parent_node = tcx. hir . find ( parent) ;
472472 match parent_node {
473473 Some ( node) => match node {
474474 ast_map:: NodeItem ( item) => match item. node {
@@ -1068,8 +1068,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
10681068
10691069 fn give_suggestion ( & self , err : & mut DiagnosticBuilder , same_regions : & [ SameRegions ] ) {
10701070 let scope_id = same_regions[ 0 ] . scope_id ;
1071- let parent = self . tcx . map . get_parent ( scope_id) ;
1072- let parent_node = self . tcx . map . find ( parent) ;
1071+ let parent = self . tcx . hir . get_parent ( scope_id) ;
1072+ let parent_node = self . tcx . hir . find ( parent) ;
10731073 let taken = lifetimes_in_scope ( self . tcx , scope_id) ;
10741074 let life_giver = LifeGiver :: with_taken ( & taken[ ..] ) ;
10751075 let node_inner = match parent_node {
@@ -1083,8 +1083,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
10831083 }
10841084 }
10851085 ast_map:: NodeImplItem ( item) => {
1086- let id = self . tcx . map . get_parent ( item. id ) ;
1087- if let Some ( ast_map:: NodeItem ( parent_scope) ) = self . tcx . map . find ( id) {
1086+ let id = self . tcx . hir . get_parent ( item. id ) ;
1087+ if let Some ( ast_map:: NodeItem ( parent_scope) ) = self . tcx . hir . find ( id) {
10881088 if let hir:: ItemImpl ( _, _, _, None , _, _) = parent_scope. node {
10891089 // this impl scope implements a trait, do not recomend
10901090 // using explicit lifetimes (#37363)
@@ -1654,7 +1654,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
16541654 generics : & hir:: Generics ,
16551655 span : Span ,
16561656 body : hir:: BodyId ) {
1657- let s = hir:: print:: to_string ( & self . tcx . map , |s| {
1657+ let s = hir:: print:: to_string ( & self . tcx . hir , |s| {
16581658 use syntax:: abi:: Abi ;
16591659 use syntax:: print:: pprust:: PrintState ;
16601660
@@ -1891,8 +1891,8 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
18911891 scope_id : ast:: NodeId )
18921892 -> Vec < hir:: LifetimeDef > {
18931893 let mut taken = Vec :: new ( ) ;
1894- let parent = tcx. map . get_parent ( scope_id) ;
1895- let method_id_opt = match tcx. map . find ( parent) {
1894+ let parent = tcx. hir . get_parent ( scope_id) ;
1895+ let method_id_opt = match tcx. hir . find ( parent) {
18961896 Some ( node) => match node {
18971897 ast_map:: NodeItem ( item) => match item. node {
18981898 hir:: ItemFn ( .., ref gen, _) => {
@@ -1915,8 +1915,8 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
19151915 None => None
19161916 } ;
19171917 if let Some ( method_id) = method_id_opt {
1918- let parent = tcx. map . get_parent ( method_id) ;
1919- if let Some ( node) = tcx. map . find ( parent) {
1918+ let parent = tcx. hir . get_parent ( method_id) ;
1919+ if let Some ( node) = tcx. hir . find ( parent) {
19201920 match node {
19211921 ast_map:: NodeItem ( item) => match item. node {
19221922 hir:: ItemImpl ( _, _, ref gen, ..) => {
0 commit comments