@@ -1406,9 +1406,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14061406 _ => ConstraintCategory :: Assignment ,
14071407 } ;
14081408
1409- let place_ty = place. ty ( body. body ( ) , tcx) . ty ;
1409+ let place_ty = place. ty ( & * body, tcx) . ty ;
14101410 let place_ty = self . normalize ( place_ty, location) ;
1411- let rv_ty = rv. ty ( body. body ( ) , tcx) ;
1411+ let rv_ty = rv. ty ( & * body, tcx) ;
14121412 let rv_ty = self . normalize ( rv_ty, location) ;
14131413 if let Err ( terr) =
14141414 self . sub_types_or_anon ( rv_ty, place_ty, location. to_locations ( ) , category)
@@ -1460,7 +1460,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14601460 ref place,
14611461 variant_index,
14621462 } => {
1463- let place_type = place. ty ( body. body ( ) , tcx) . ty ;
1463+ let place_type = place. ty ( & * body, tcx) . ty ;
14641464 let adt = match place_type. kind {
14651465 ty:: Adt ( adt, _) if adt. is_enum ( ) => adt,
14661466 _ => {
@@ -1482,7 +1482,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14821482 } ;
14831483 }
14841484 StatementKind :: AscribeUserType ( box( ref place, ref projection) , variance) => {
1485- let place_ty = place. ty ( body. body ( ) , tcx) . ty ;
1485+ let place_ty = place. ty ( & * body, tcx) . ty ;
14861486 if let Err ( terr) = self . relate_type_and_user_type (
14871487 place_ty,
14881488 variance,
@@ -1998,7 +1998,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19981998 // While this is located in `nll::typeck` this error is not an NLL error, it's
19991999 // a required check to make sure that repeated elements implement `Copy`.
20002000 let span = body. source_info ( location) . span ;
2001- let ty = operand. ty ( body. body ( ) , tcx) ;
2001+ let ty = operand. ty ( & * body, tcx) ;
20022002 if !self . infcx . type_is_copy_modulo_regions ( self . param_env , ty, span) {
20032003 // To determine if `const_in_array_repeat_expressions` feature gate should
20042004 // be mentioned, need to check if the rvalue is promotable.
@@ -2052,7 +2052,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20522052 Rvalue :: Cast ( cast_kind, op, ty) => {
20532053 match cast_kind {
20542054 CastKind :: Pointer ( PointerCast :: ReifyFnPointer ) => {
2055- let fn_sig = op. ty ( body. body ( ) , tcx) . fn_sig ( tcx) ;
2055+ let fn_sig = op. ty ( & * body, tcx) . fn_sig ( tcx) ;
20562056
20572057 // The type that we see in the fcx is like
20582058 // `foo::<'a, 'b>`, where `foo` is the path to a
@@ -2081,7 +2081,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20812081 }
20822082
20832083 CastKind :: Pointer ( PointerCast :: ClosureFnPointer ( unsafety) ) => {
2084- let sig = match op. ty ( body. body ( ) , tcx) . kind {
2084+ let sig = match op. ty ( & * body, tcx) . kind {
20852085 ty:: Closure ( def_id, substs) => {
20862086 substs. as_closure ( ) . sig_ty ( def_id, tcx) . fn_sig ( tcx)
20872087 }
@@ -2107,7 +2107,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21072107 }
21082108
21092109 CastKind :: Pointer ( PointerCast :: UnsafeFnPointer ) => {
2110- let fn_sig = op. ty ( body. body ( ) , tcx) . fn_sig ( tcx) ;
2110+ let fn_sig = op. ty ( & * body, tcx) . fn_sig ( tcx) ;
21112111
21122112 // The type that we see in the fcx is like
21132113 // `foo::<'a, 'b>`, where `foo` is the path to a
@@ -2139,7 +2139,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21392139 let & ty = ty;
21402140 let trait_ref = ty:: TraitRef {
21412141 def_id : tcx. lang_items ( ) . coerce_unsized_trait ( ) . unwrap ( ) ,
2142- substs : tcx. mk_substs_trait ( op. ty ( body. body ( ) , tcx) , & [ ty. into ( ) ] ) ,
2142+ substs : tcx. mk_substs_trait ( op. ty ( & * body, tcx) , & [ ty. into ( ) ] ) ,
21432143 } ;
21442144
21452145 self . prove_trait_ref (
@@ -2150,7 +2150,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21502150 }
21512151
21522152 CastKind :: Pointer ( PointerCast :: MutToConstPointer ) => {
2153- let ty_from = match op. ty ( body. body ( ) , tcx) . kind {
2153+ let ty_from = match op. ty ( & * body, tcx) . kind {
21542154 ty:: RawPtr ( ty:: TypeAndMut {
21552155 ty : ty_from,
21562156 mutbl : hir:: Mutability :: Mutable ,
@@ -2198,7 +2198,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21982198 }
21992199
22002200 CastKind :: Pointer ( PointerCast :: ArrayToPointer ) => {
2201- let ty_from = op. ty ( body. body ( ) , tcx) ;
2201+ let ty_from = op. ty ( & * body, tcx) ;
22022202
22032203 let opt_ty_elem = match ty_from. kind {
22042204 ty:: RawPtr (
@@ -2260,7 +2260,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
22602260 }
22612261
22622262 CastKind :: Misc => {
2263- let ty_from = op. ty ( body. body ( ) , tcx) ;
2263+ let ty_from = op. ty ( & * body, tcx) ;
22642264 let cast_ty_from = CastTy :: from_ty ( ty_from) ;
22652265 let cast_ty_to = CastTy :: from_ty ( ty) ;
22662266 match ( cast_ty_from, cast_ty_to) {
@@ -2327,9 +2327,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
23272327 | Rvalue :: BinaryOp ( BinOp :: Le , left, right)
23282328 | Rvalue :: BinaryOp ( BinOp :: Gt , left, right)
23292329 | Rvalue :: BinaryOp ( BinOp :: Ge , left, right) => {
2330- let ty_left = left. ty ( body. body ( ) , tcx) ;
2330+ let ty_left = left. ty ( & * body, tcx) ;
23312331 if let ty:: RawPtr ( _) | ty:: FnPtr ( _) = ty_left. kind {
2332- let ty_right = right. ty ( body. body ( ) , tcx) ;
2332+ let ty_right = right. ty ( & * body, tcx) ;
23332333 let common_ty = self . infcx . next_ty_var (
23342334 TypeVariableOrigin {
23352335 kind : TypeVariableOriginKind :: MiscVariable ,
0 commit comments