@@ -6,7 +6,7 @@ use rustc_middle::ty::{self, Ty};
6
6
use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
7
7
use rustc_span:: source_map:: Span ;
8
8
use rustc_target:: abi:: LayoutOf ;
9
- use rustc_typeck:: expr_use_visitor:: { ConsumeMode , Delegate , ExprUseVisitor , Place , PlaceBase } ;
9
+ use rustc_typeck:: expr_use_visitor:: { ConsumeMode , Delegate , ExprUseVisitor , PlaceBase , PlaceWithHirId } ;
10
10
11
11
use crate :: utils:: span_lint;
12
12
@@ -112,9 +112,9 @@ fn is_argument(map: rustc_middle::hir::map::Map<'_>, id: HirId) -> bool {
112
112
}
113
113
114
114
impl < ' a , ' tcx > Delegate < ' tcx > for EscapeDelegate < ' a , ' tcx > {
115
- fn consume ( & mut self , cmt : & Place < ' tcx > , mode : ConsumeMode ) {
116
- if cmt. projections . is_empty ( ) {
117
- if let PlaceBase :: Local ( lid) = cmt. base {
115
+ fn consume ( & mut self , cmt : & PlaceWithHirId < ' tcx > , mode : ConsumeMode ) {
116
+ if cmt. place . projections . is_empty ( ) {
117
+ if let PlaceBase :: Local ( lid) = cmt. place . base {
118
118
if let ConsumeMode :: Move = mode {
119
119
// moved out or in. clearly can't be localized
120
120
self . set . remove ( & lid) ;
@@ -132,16 +132,16 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
132
132
}
133
133
}
134
134
135
- fn borrow ( & mut self , cmt : & Place < ' tcx > , _: ty:: BorrowKind ) {
136
- if cmt. projections . is_empty ( ) {
137
- if let PlaceBase :: Local ( lid) = cmt. base {
135
+ fn borrow ( & mut self , cmt : & PlaceWithHirId < ' tcx > , _: ty:: BorrowKind ) {
136
+ if cmt. place . projections . is_empty ( ) {
137
+ if let PlaceBase :: Local ( lid) = cmt. place . base {
138
138
self . set . remove ( & lid) ;
139
139
}
140
140
}
141
141
}
142
142
143
- fn mutate ( & mut self , cmt : & Place < ' tcx > ) {
144
- if cmt. projections . is_empty ( ) {
143
+ fn mutate ( & mut self , cmt : & PlaceWithHirId < ' tcx > ) {
144
+ if cmt. place . projections . is_empty ( ) {
145
145
let map = & self . cx . tcx . hir ( ) ;
146
146
if is_argument ( * map, cmt. hir_id ) {
147
147
// Skip closure arguments
@@ -150,7 +150,7 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
150
150
return ;
151
151
}
152
152
153
- if is_non_trait_box ( cmt. ty ) && !self . is_large_box ( cmt. ty ) {
153
+ if is_non_trait_box ( cmt. place . ty ) && !self . is_large_box ( cmt. place . ty ) {
154
154
self . set . insert ( cmt. hir_id ) ;
155
155
}
156
156
return ;
0 commit comments