@@ -84,7 +84,7 @@ impl<'a, 'b, 'gcx, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'gcx, 'tcx> {
8484
8585 fn visit_rvalue ( & mut self , rvalue : & Rvalue < ' tcx > , location : Location ) {
8686 self . super_rvalue ( rvalue, location) ;
87- let rval_ty = rvalue. ty ( & self . mir . local_decls , self . tcx ( ) ) ;
87+ let rval_ty = rvalue. ty ( self . mir , self . tcx ( ) ) ;
8888 self . sanitize_type ( rvalue, rval_ty) ;
8989 }
9090
@@ -178,7 +178,7 @@ impl<'a, 'b, 'gcx, 'tcx> TypeVerifier<'a, 'b, 'gcx, 'tcx> {
178178 }
179179 ProjectionElem :: Index ( ref i) => {
180180 self . visit_operand ( i, location) ;
181- let index_ty = i. ty ( & self . mir . local_decls , tcx) ;
181+ let index_ty = i. ty ( self . mir , tcx) ;
182182 if index_ty != tcx. types . usize {
183183 LvalueTy :: Ty {
184184 ty : span_mirbug_and_err ! ( self , i, "index by non-usize {:?}" , i)
@@ -378,15 +378,15 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
378378 let tcx = self . tcx ( ) ;
379379 match stmt. kind {
380380 StatementKind :: Assign ( ref lv, ref rv) => {
381- let lv_ty = lv. ty ( & mir. local_decls , tcx) . to_ty ( tcx) ;
382- let rv_ty = rv. ty ( & mir. local_decls , tcx) ;
381+ let lv_ty = lv. ty ( mir, tcx) . to_ty ( tcx) ;
382+ let rv_ty = rv. ty ( mir, tcx) ;
383383 if let Err ( terr) = self . sub_types ( rv_ty, lv_ty) {
384384 span_mirbug ! ( self , stmt, "bad assignment ({:?} = {:?}): {:?}" ,
385385 lv_ty, rv_ty, terr) ;
386386 }
387387 }
388388 StatementKind :: SetDiscriminant { ref lvalue, variant_index } => {
389- let lvalue_type = lvalue. ty ( & mir. local_decls , tcx) . to_ty ( tcx) ;
389+ let lvalue_type = lvalue. ty ( mir, tcx) . to_ty ( tcx) ;
390390 let adt = match lvalue_type. sty {
391391 TypeVariants :: TyAdt ( adt, _) if adt. is_enum ( ) => adt,
392392 _ => {
@@ -438,15 +438,15 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
438438 ref value,
439439 ..
440440 } => {
441- let lv_ty = location. ty ( & mir. local_decls , tcx) . to_ty ( tcx) ;
442- let rv_ty = value. ty ( & mir. local_decls , tcx) ;
441+ let lv_ty = location. ty ( mir, tcx) . to_ty ( tcx) ;
442+ let rv_ty = value. ty ( mir, tcx) ;
443443 if let Err ( terr) = self . sub_types ( rv_ty, lv_ty) {
444444 span_mirbug ! ( self , term, "bad DropAndReplace ({:?} = {:?}): {:?}" ,
445445 lv_ty, rv_ty, terr) ;
446446 }
447447 }
448448 TerminatorKind :: SwitchInt { ref discr, switch_ty, .. } => {
449- let discr_ty = discr. ty ( & mir. local_decls , tcx) ;
449+ let discr_ty = discr. ty ( mir, tcx) ;
450450 if let Err ( terr) = self . sub_types ( discr_ty, switch_ty) {
451451 span_mirbug ! ( self , term, "bad SwitchInt ({:?} on {:?}): {:?}" ,
452452 switch_ty, discr_ty, terr) ;
@@ -459,7 +459,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
459459 // FIXME: check the values
460460 }
461461 TerminatorKind :: Call { ref func, ref args, ref destination, .. } => {
462- let func_ty = func. ty ( & mir. local_decls , tcx) ;
462+ let func_ty = func. ty ( mir, tcx) ;
463463 debug ! ( "check_terminator: call, func_ty={:?}" , func_ty) ;
464464 let sig = match func_ty. sty {
465465 ty:: TyFnDef ( ..) | ty:: TyFnPtr ( _) => func_ty. fn_sig ( tcx) ,
@@ -479,16 +479,16 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
479479 }
480480 }
481481 TerminatorKind :: Assert { ref cond, ref msg, .. } => {
482- let cond_ty = cond. ty ( & mir. local_decls , tcx) ;
482+ let cond_ty = cond. ty ( mir, tcx) ;
483483 if cond_ty != tcx. types . bool {
484484 span_mirbug ! ( self , term, "bad Assert ({:?}, not bool" , cond_ty) ;
485485 }
486486
487487 if let AssertMessage :: BoundsCheck { ref len, ref index } = * msg {
488- if len. ty ( & mir. local_decls , tcx) != tcx. types . usize {
488+ if len. ty ( mir, tcx) != tcx. types . usize {
489489 span_mirbug ! ( self , len, "bounds-check length non-usize {:?}" , len)
490490 }
491- if index. ty ( & mir. local_decls , tcx) != tcx. types . usize {
491+ if index. ty ( mir, tcx) != tcx. types . usize {
492492 span_mirbug ! ( self , index, "bounds-check index non-usize {:?}" , index)
493493 }
494494 }
@@ -504,7 +504,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
504504 let tcx = self . tcx ( ) ;
505505 match * destination {
506506 Some ( ( ref dest, _) ) => {
507- let dest_ty = dest. ty ( & mir. local_decls , tcx) . to_ty ( tcx) ;
507+ let dest_ty = dest. ty ( mir, tcx) . to_ty ( tcx) ;
508508 if let Err ( terr) = self . sub_types ( sig. output ( ) , dest_ty) {
509509 span_mirbug ! ( self , term,
510510 "call dest mismatch ({:?} <- {:?}): {:?}" ,
@@ -532,7 +532,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
532532 span_mirbug ! ( self , term, "call to {:?} with wrong # of args" , sig) ;
533533 }
534534 for ( n, ( fn_arg, op_arg) ) in sig. inputs ( ) . iter ( ) . zip ( args) . enumerate ( ) {
535- let op_arg_ty = op_arg. ty ( & mir. local_decls , self . tcx ( ) ) ;
535+ let op_arg_ty = op_arg. ty ( mir, self . tcx ( ) ) ;
536536 if let Err ( terr) = self . sub_types ( op_arg_ty, fn_arg) {
537537 span_mirbug ! ( self , term, "bad arg #{:?} ({:?} <- {:?}): {:?}" ,
538538 n, fn_arg, op_arg_ty, terr) ;
@@ -581,7 +581,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
581581 return ;
582582 }
583583
584- let ty = args[ 0 ] . ty ( & mir. local_decls , self . tcx ( ) ) ;
584+ let ty = args[ 0 ] . ty ( mir, self . tcx ( ) ) ;
585585 let arg_ty = match ty. sty {
586586 ty:: TyRawPtr ( mt) => mt. ty ,
587587 ty:: TyAdt ( def, _) if def. is_box ( ) => ty. boxed_ty ( ) ,
0 commit comments