@@ -5,7 +5,7 @@ use rustc_infer::infer::TyCtxtInferExt;
5
5
use rustc_lint:: { LateContext , LateLintPass } ;
6
6
use rustc_middle:: mir:: FakeReadCause ;
7
7
use rustc_middle:: ty:: layout:: LayoutOf ;
8
- use rustc_middle:: ty:: { self , TraitRef , Ty } ;
8
+ use rustc_middle:: ty:: { self , TraitRef , Ty , TyCtxt } ;
9
9
use rustc_session:: impl_lint_pass;
10
10
use rustc_span:: def_id:: LocalDefId ;
11
11
use rustc_span:: symbol:: kw;
@@ -122,16 +122,16 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
122
122
}
123
123
124
124
// TODO: Replace with Map::is_argument(..) when it's fixed
125
- fn is_argument ( map : rustc_middle :: hir :: map :: Map < ' _ > , id : HirId ) -> bool {
126
- match map . find ( id) {
125
+ fn is_argument ( tcx : TyCtxt < ' _ > , id : HirId ) -> bool {
126
+ match tcx . opt_hir_node ( id) {
127
127
Some ( Node :: Pat ( Pat {
128
128
kind : PatKind :: Binding ( ..) ,
129
129
..
130
130
} ) ) => ( ) ,
131
131
_ => return false ,
132
132
}
133
133
134
- matches ! ( map . find_parent( id) , Some ( Node :: Param ( _) ) )
134
+ matches ! ( tcx . hir ( ) . find_parent( id) , Some ( Node :: Param ( _) ) )
135
135
}
136
136
137
137
impl < ' a , ' tcx > Delegate < ' tcx > for EscapeDelegate < ' a , ' tcx > {
@@ -154,7 +154,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
154
154
fn mutate ( & mut self , cmt : & PlaceWithHirId < ' tcx > , _: HirId ) {
155
155
if cmt. place . projections . is_empty ( ) {
156
156
let map = & self . cx . tcx . hir ( ) ;
157
- if is_argument ( * map , cmt. hir_id ) {
157
+ if is_argument ( self . cx . tcx , cmt. hir_id ) {
158
158
// Skip closure arguments
159
159
let parent_id = map. parent_id ( cmt. hir_id ) ;
160
160
if let Some ( Node :: Expr ( ..) ) = map. find_parent ( parent_id) {
0 commit comments