@@ -113,18 +113,6 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
113113 }
114114 }
115115 let map = & self . cx . tcx . hir ( ) ;
116- if is_argument ( map, cmt. hir_id ) {
117- // Skip closure arguments
118- let parent_id = map. get_parent_node ( cmt. hir_id ) ;
119- if let Some ( Node :: Expr ( ..) ) = map. find ( map. get_parent_node ( parent_id) ) {
120- return ;
121- }
122-
123- if is_non_trait_box ( cmt. ty ) && !self . is_large_box ( cmt. ty ) {
124- self . set . insert ( cmt. hir_id ) ;
125- }
126- return ;
127- }
128116 if let Categorization :: Local ( lid) = cmt. cat {
129117 if let Some ( Node :: Binding ( _) ) = map. find ( cmt. hir_id ) {
130118 if self . set . contains ( & lid) {
@@ -143,7 +131,21 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
143131 }
144132 }
145133
146- fn mutate ( & mut self , _: & cmt_ < ' tcx > ) { }
134+ fn mutate ( & mut self , cmt : & cmt_ < ' tcx > ) {
135+ let map = & self . cx . tcx . hir ( ) ;
136+ if is_argument ( map, cmt. hir_id ) {
137+ // Skip closure arguments
138+ let parent_id = map. get_parent_node ( cmt. hir_id ) ;
139+ if let Some ( Node :: Expr ( ..) ) = map. find ( map. get_parent_node ( parent_id) ) {
140+ return ;
141+ }
142+
143+ if is_non_trait_box ( cmt. ty ) && !self . is_large_box ( cmt. ty ) {
144+ self . set . insert ( cmt. hir_id ) ;
145+ }
146+ return ;
147+ }
148+ }
147149}
148150
149151impl < ' a , ' tcx > EscapeDelegate < ' a , ' tcx > {
0 commit comments