@@ -5,7 +5,7 @@ use rustc_infer::infer::TyCtxtInferExt;
55use rustc_lint:: { LateContext , LateLintPass } ;
66use rustc_middle:: mir:: FakeReadCause ;
77use rustc_middle:: ty:: layout:: LayoutOf ;
8- use rustc_middle:: ty:: { self , TraitRef , Ty } ;
8+ use rustc_middle:: ty:: { self , TraitRef , Ty , TyCtxt } ;
99use rustc_session:: impl_lint_pass;
1010use rustc_span:: def_id:: LocalDefId ;
1111use rustc_span:: symbol:: kw;
@@ -122,16 +122,16 @@ impl<'tcx> LateLintPass<'tcx> for BoxedLocal {
122122}
123123
124124// 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) {
127127 Some ( Node :: Pat ( Pat {
128128 kind : PatKind :: Binding ( ..) ,
129129 ..
130130 } ) ) => ( ) ,
131131 _ => return false ,
132132 }
133133
134- matches ! ( map . find_parent( id) , Some ( Node :: Param ( _) ) )
134+ matches ! ( tcx . hir ( ) . find_parent( id) , Some ( Node :: Param ( _) ) )
135135}
136136
137137impl < ' a , ' tcx > Delegate < ' tcx > for EscapeDelegate < ' a , ' tcx > {
@@ -154,7 +154,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
154154 fn mutate ( & mut self , cmt : & PlaceWithHirId < ' tcx > , _: HirId ) {
155155 if cmt. place . projections . is_empty ( ) {
156156 let map = & self . cx . tcx . hir ( ) ;
157- if is_argument ( * map , cmt. hir_id ) {
157+ if is_argument ( self . cx . tcx , cmt. hir_id ) {
158158 // Skip closure arguments
159159 let parent_id = map. parent_id ( cmt. hir_id ) ;
160160 if let Some ( Node :: Expr ( ..) ) = map. find_parent ( parent_id) {
0 commit comments