@@ -113,18 +113,6 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
113
113
}
114
114
}
115
115
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
- }
128
116
if let Categorization :: Local ( lid) = cmt. cat {
129
117
if let Some ( Node :: Binding ( _) ) = map. find ( cmt. hir_id ) {
130
118
if self . set . contains ( & lid) {
@@ -143,7 +131,21 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
143
131
}
144
132
}
145
133
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
+ }
147
149
}
148
150
149
151
impl < ' a , ' tcx > EscapeDelegate < ' a , ' tcx > {
0 commit comments