@@ -143,7 +143,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
143
143
let pred_arg = if_chain ! {
144
144
if let Some ( ( pred_fn_def_id, pred_arg, pred_arg_ty, Some ( res) ) ) =
145
145
is_call_with_ref_arg( cx, mir, & pred_terminator. kind) ;
146
- if * res == mir:: Place :: Local ( cloned) ;
146
+ if * res == mir:: Place :: Base ( mir :: PlaceBase :: Local ( cloned) ) ;
147
147
if match_def_path( cx. tcx, pred_fn_def_id, & paths:: DEREF_TRAIT_METHOD ) ;
148
148
if match_type( cx, pred_arg_ty, & paths:: PATH_BUF )
149
149
|| match_type( cx, pred_arg_ty, & paths:: OS_STRING ) ;
@@ -229,7 +229,7 @@ fn is_call_with_ref_arg<'tcx>(
229
229
if_chain ! {
230
230
if let TerminatorKind :: Call { func, args, destination, .. } = kind;
231
231
if args. len( ) == 1 ;
232
- if let mir:: Operand :: Move ( mir:: Place :: Local ( local) ) = & args[ 0 ] ;
232
+ if let mir:: Operand :: Move ( mir:: Place :: Base ( mir :: PlaceBase :: Local ( local) ) ) = & args[ 0 ] ;
233
233
if let ty:: FnDef ( def_id, _) = func. ty( & * mir, cx. tcx) . sty;
234
234
if let ( inner_ty, 1 ) = walk_ptrs_ty_depth( args[ 0 ] . ty( & * mir, cx. tcx) ) ;
235
235
if !is_copy( cx, inner_ty) ;
@@ -255,7 +255,7 @@ fn find_stmt_assigns_to<'a, 'tcx: 'a>(
255
255
stmts
256
256
. rev ( )
257
257
. find_map ( |stmt| {
258
- if let mir:: StatementKind :: Assign ( mir:: Place :: Local ( local) , v) = & stmt. kind {
258
+ if let mir:: StatementKind :: Assign ( mir:: Place :: Base ( mir :: PlaceBase :: Local ( local) ) , v) = & stmt. kind {
259
259
if * local == to {
260
260
return Some ( v) ;
261
261
}
@@ -285,6 +285,7 @@ fn base_local_and_movability<'tcx>(
285
285
mut place : & mir:: Place < ' tcx > ,
286
286
) -> Option < ( mir:: Local , CannotMoveOut ) > {
287
287
use rustc:: mir:: Place :: * ;
288
+ use rustc:: mir:: PlaceBase ;
288
289
289
290
// Dereference. You cannot move things out from a borrowed value.
290
291
let mut deref = false ;
@@ -293,7 +294,7 @@ fn base_local_and_movability<'tcx>(
293
294
294
295
loop {
295
296
match place {
296
- Local ( local) => return Some ( ( * local, deref || field) ) ,
297
+ Base ( PlaceBase :: Local ( local) ) => return Some ( ( * local, deref || field) ) ,
297
298
Projection ( proj) => {
298
299
place = & proj. base ;
299
300
deref = deref || matches ! ( proj. elem, mir:: ProjectionElem :: Deref ) ;
0 commit comments