@@ -355,7 +355,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
355355 let tcx = self . tcx ( ) ;
356356 match stmt. kind {
357357 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) ;
359359 let rv_ty = mir. rvalue_ty ( tcx, rv) ;
360360 if let Some ( rv_ty) = rv_ty {
361361 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> {
390390 ref value,
391391 ..
392392 } => {
393- let lv_ty = mir . lvalue_ty ( tcx , location ) . to_ty ( tcx) ;
393+ let lv_ty = location . ty ( mir , tcx ) . to_ty ( tcx) ;
394394 let rv_ty = mir. operand_ty ( tcx, value) ;
395395 if let Err ( terr) = self . sub_types ( self . last_span , rv_ty, lv_ty) {
396396 span_mirbug ! ( self , term, "bad DropAndReplace ({:?} = {:?}): {:?}" ,
@@ -408,7 +408,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
408408 }
409409 }
410410 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) ;
412412 if let Err ( terr) = self . sub_types ( self . last_span , discr_ty, switch_ty) {
413413 span_mirbug ! ( self , term, "bad SwitchInt ({:?} on {:?}): {:?}" ,
414414 switch_ty, discr_ty, terr) ;
@@ -421,7 +421,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
421421 // FIXME: check the values
422422 }
423423 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) ;
425425 match discr_ty. sty {
426426 ty:: TyEnum ( def, _)
427427 if def == adt_def && adt_def. variants . len ( ) == targets. len ( )
@@ -481,7 +481,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
481481 span_mirbug ! ( self , term, "call to diverging function {:?} with dest" , sig) ;
482482 }
483483 ( & 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) ;
485485 if let Err ( terr) = self . sub_types ( self . last_span , ty, dest_ty) {
486486 span_mirbug ! ( self , term,
487487 "call dest mismatch ({:?} <- {:?}): {:?}" ,
0 commit comments