@@ -131,7 +131,7 @@ impl<'tcx> MirPass<'tcx> for EarlyOtherwiseBranch {
131
131
Operand :: Copy ( x) => Operand :: Copy ( * x) ,
132
132
Operand :: Constant ( x) => Operand :: Constant ( x. clone ( ) ) ,
133
133
} ;
134
- let parent_ty = parent_op. ty ( body. local_decls ( ) , tcx) ;
134
+ let parent_ty = parent_op. ty ( body, tcx) ;
135
135
let statements_before = bbs[ parent] . statements . len ( ) ;
136
136
let parent_end = Location { block : parent, statement_index : statements_before } ;
137
137
@@ -268,7 +268,7 @@ fn may_hoist<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, place: Place<'tcx>) ->
268
268
// `otherwise` branch in `BBC, BBD` in the input to our transformation, which would
269
269
// have invalidated the data when computing `discriminant(P)`
270
270
// So dereferencing here is correct.
271
- ProjectionElem :: Deref => match place. ty ( body. local_decls ( ) , tcx) . ty . kind ( ) {
271
+ ProjectionElem :: Deref => match place. ty ( body, tcx) . ty . kind ( ) {
272
272
ty:: Ref ( ..) => { }
273
273
_ => return false ,
274
274
} ,
@@ -317,7 +317,7 @@ fn evaluate_candidate<'tcx>(
317
317
} = & bbs[ parent] . terminator ( ) . kind else {
318
318
return None
319
319
} ;
320
- let parent_ty = parent_discr. ty ( body. local_decls ( ) , tcx) ;
320
+ let parent_ty = parent_discr. ty ( body, tcx) ;
321
321
let parent_dest = {
322
322
let poss = targets. otherwise ( ) ;
323
323
// If the fallthrough on the parent is trivially unreachable, we can let the
@@ -338,7 +338,7 @@ fn evaluate_candidate<'tcx>(
338
338
} = & child_terminator. kind else {
339
339
return None
340
340
} ;
341
- let child_ty = child_discr. ty ( body. local_decls ( ) , tcx) ;
341
+ let child_ty = child_discr. ty ( body, tcx) ;
342
342
if child_ty != parent_ty {
343
343
return None ;
344
344
}
0 commit comments