@@ -144,14 +144,14 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
144
144
format ! ( "{}unknown scope: {:?}{}. Please report a bug." ,
145
145
prefix, scope, suffix)
146
146
} ;
147
- let span = match scope. span ( & self . region_maps , & self . map ) {
147
+ let span = match scope. span ( & self . region_maps , & self . hir ) {
148
148
Some ( s) => s,
149
149
None => {
150
150
err. note ( & unknown_scope ( ) ) ;
151
151
return ;
152
152
}
153
153
} ;
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 ) ) {
155
155
Some ( ast_map:: NodeBlock ( _) ) => "block" ,
156
156
Some ( ast_map:: NodeExpr ( expr) ) => match expr. node {
157
157
hir:: ExprCall ( ..) => "call" ,
@@ -206,7 +206,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
206
206
207
207
let node = fr. scope . node_id ( & self . region_maps ) ;
208
208
let unknown;
209
- let tag = match self . map . find ( node) {
209
+ let tag = match self . hir . find ( node) {
210
210
Some ( ast_map:: NodeBlock ( _) ) |
211
211
Some ( ast_map:: NodeExpr ( _) ) => "body" ,
212
212
Some ( ast_map:: NodeItem ( it) ) => item_scope_tag ( & it) ,
@@ -218,7 +218,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
218
218
Some ( _) => {
219
219
unknown = format ! ( "unexpected node ({}) for scope {:?}. \
220
220
Please report a bug.",
221
- self . map . node_to_string( node) , fr. scope) ;
221
+ self . hir . node_to_string( node) , fr. scope) ;
222
222
& unknown
223
223
}
224
224
None => {
@@ -227,7 +227,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
227
227
& unknown
228
228
}
229
229
} ;
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) ) ;
231
231
( format ! ( "{} {}" , prefix, msg) , opt_span)
232
232
}
233
233
@@ -467,8 +467,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
467
467
} ,
468
468
_ => return None
469
469
} ;
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) ;
472
472
match parent_node {
473
473
Some ( node) => match node {
474
474
ast_map:: NodeItem ( item) => match item. node {
@@ -1068,8 +1068,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1068
1068
1069
1069
fn give_suggestion ( & self , err : & mut DiagnosticBuilder , same_regions : & [ SameRegions ] ) {
1070
1070
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) ;
1073
1073
let taken = lifetimes_in_scope ( self . tcx , scope_id) ;
1074
1074
let life_giver = LifeGiver :: with_taken ( & taken[ ..] ) ;
1075
1075
let node_inner = match parent_node {
@@ -1083,8 +1083,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1083
1083
}
1084
1084
}
1085
1085
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) {
1088
1088
if let hir:: ItemImpl ( _, _, _, None , _, _) = parent_scope. node {
1089
1089
// this impl scope implements a trait, do not recomend
1090
1090
// using explicit lifetimes (#37363)
@@ -1654,7 +1654,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1654
1654
generics : & hir:: Generics ,
1655
1655
span : Span ,
1656
1656
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| {
1658
1658
use syntax:: abi:: Abi ;
1659
1659
use syntax:: print:: pprust:: PrintState ;
1660
1660
@@ -1891,8 +1891,8 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
1891
1891
scope_id : ast:: NodeId )
1892
1892
-> Vec < hir:: LifetimeDef > {
1893
1893
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) {
1896
1896
Some ( node) => match node {
1897
1897
ast_map:: NodeItem ( item) => match item. node {
1898
1898
hir:: ItemFn ( .., ref gen, _) => {
@@ -1915,8 +1915,8 @@ fn lifetimes_in_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
1915
1915
None => None
1916
1916
} ;
1917
1917
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) {
1920
1920
match node {
1921
1921
ast_map:: NodeItem ( item) => match item. node {
1922
1922
hir:: ItemImpl ( _, _, ref gen, ..) => {
0 commit comments