@@ -355,7 +355,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
355
355
let tcx = self . tcx ( ) ;
356
356
match stmt. kind {
357
357
StatementKind :: Assign ( ref lv, ref rv) => {
358
- let lv_ty = mir . lvalue_ty ( tcx , lv ) . to_ty ( tcx) ;
358
+ let lv_ty = lv . ty ( mir , tcx ) . to_ty ( tcx) ;
359
359
let rv_ty = mir. rvalue_ty ( tcx, rv) ;
360
360
if let Some ( rv_ty) = rv_ty {
361
361
if let Err ( terr) = self . sub_types ( self . last_span , rv_ty, lv_ty) {
@@ -390,7 +390,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
390
390
ref value,
391
391
..
392
392
} => {
393
- let lv_ty = mir . lvalue_ty ( tcx , location ) . to_ty ( tcx) ;
393
+ let lv_ty = location . ty ( mir , tcx ) . to_ty ( tcx) ;
394
394
let rv_ty = mir. operand_ty ( tcx, value) ;
395
395
if let Err ( terr) = self . sub_types ( self . last_span , rv_ty, lv_ty) {
396
396
span_mirbug ! ( self , term, "bad DropAndReplace ({:?} = {:?}): {:?}" ,
@@ -408,7 +408,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
408
408
}
409
409
}
410
410
TerminatorKind :: SwitchInt { ref discr, switch_ty, .. } => {
411
- let discr_ty = mir . lvalue_ty ( tcx , discr ) . to_ty ( tcx) ;
411
+ let discr_ty = discr . ty ( mir , tcx ) . to_ty ( tcx) ;
412
412
if let Err ( terr) = self . sub_types ( self . last_span , discr_ty, switch_ty) {
413
413
span_mirbug ! ( self , term, "bad SwitchInt ({:?} on {:?}): {:?}" ,
414
414
switch_ty, discr_ty, terr) ;
@@ -421,7 +421,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
421
421
// FIXME: check the values
422
422
}
423
423
TerminatorKind :: Switch { ref discr, adt_def, ref targets } => {
424
- let discr_ty = mir . lvalue_ty ( tcx , discr ) . to_ty ( tcx) ;
424
+ let discr_ty = discr . ty ( mir , tcx ) . to_ty ( tcx) ;
425
425
match discr_ty. sty {
426
426
ty:: TyEnum ( def, _)
427
427
if def == adt_def && adt_def. variants . len ( ) == targets. len ( )
@@ -481,7 +481,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
481
481
span_mirbug ! ( self , term, "call to diverging function {:?} with dest" , sig) ;
482
482
}
483
483
( & Some ( ( ref dest, _) ) , ty:: FnConverging ( ty) ) => {
484
- let dest_ty = mir . lvalue_ty ( tcx , dest ) . to_ty ( tcx) ;
484
+ let dest_ty = dest . ty ( mir , tcx ) . to_ty ( tcx) ;
485
485
if let Err ( terr) = self . sub_types ( self . last_span , ty, dest_ty) {
486
486
span_mirbug ! ( self , term,
487
487
"call dest mismatch ({:?} <- {:?}): {:?}" ,
0 commit comments