@@ -1406,9 +1406,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1406
1406
_ => ConstraintCategory :: Assignment ,
1407
1407
} ;
1408
1408
1409
- let place_ty = place. ty ( body. body ( ) , tcx) . ty ;
1409
+ let place_ty = place. ty ( & * body, tcx) . ty ;
1410
1410
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) ;
1412
1412
let rv_ty = self . normalize ( rv_ty, location) ;
1413
1413
if let Err ( terr) =
1414
1414
self . sub_types_or_anon ( rv_ty, place_ty, location. to_locations ( ) , category)
@@ -1460,7 +1460,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1460
1460
ref place,
1461
1461
variant_index,
1462
1462
} => {
1463
- let place_type = place. ty ( body. body ( ) , tcx) . ty ;
1463
+ let place_type = place. ty ( & * body, tcx) . ty ;
1464
1464
let adt = match place_type. kind {
1465
1465
ty:: Adt ( adt, _) if adt. is_enum ( ) => adt,
1466
1466
_ => {
@@ -1482,7 +1482,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1482
1482
} ;
1483
1483
}
1484
1484
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 ;
1486
1486
if let Err ( terr) = self . relate_type_and_user_type (
1487
1487
place_ty,
1488
1488
variance,
@@ -1998,7 +1998,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1998
1998
// While this is located in `nll::typeck` this error is not an NLL error, it's
1999
1999
// a required check to make sure that repeated elements implement `Copy`.
2000
2000
let span = body. source_info ( location) . span ;
2001
- let ty = operand. ty ( body. body ( ) , tcx) ;
2001
+ let ty = operand. ty ( & * body, tcx) ;
2002
2002
if !self . infcx . type_is_copy_modulo_regions ( self . param_env , ty, span) {
2003
2003
// To determine if `const_in_array_repeat_expressions` feature gate should
2004
2004
// be mentioned, need to check if the rvalue is promotable.
@@ -2052,7 +2052,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2052
2052
Rvalue :: Cast ( cast_kind, op, ty) => {
2053
2053
match cast_kind {
2054
2054
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) ;
2056
2056
2057
2057
// The type that we see in the fcx is like
2058
2058
// `foo::<'a, 'b>`, where `foo` is the path to a
@@ -2081,7 +2081,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2081
2081
}
2082
2082
2083
2083
CastKind :: Pointer ( PointerCast :: ClosureFnPointer ( unsafety) ) => {
2084
- let sig = match op. ty ( body. body ( ) , tcx) . kind {
2084
+ let sig = match op. ty ( & * body, tcx) . kind {
2085
2085
ty:: Closure ( def_id, substs) => {
2086
2086
substs. as_closure ( ) . sig_ty ( def_id, tcx) . fn_sig ( tcx)
2087
2087
}
@@ -2107,7 +2107,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2107
2107
}
2108
2108
2109
2109
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) ;
2111
2111
2112
2112
// The type that we see in the fcx is like
2113
2113
// `foo::<'a, 'b>`, where `foo` is the path to a
@@ -2139,7 +2139,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2139
2139
let & ty = ty;
2140
2140
let trait_ref = ty:: TraitRef {
2141
2141
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 ( ) ] ) ,
2143
2143
} ;
2144
2144
2145
2145
self . prove_trait_ref (
@@ -2150,7 +2150,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2150
2150
}
2151
2151
2152
2152
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 {
2154
2154
ty:: RawPtr ( ty:: TypeAndMut {
2155
2155
ty : ty_from,
2156
2156
mutbl : hir:: Mutability :: Mutable ,
@@ -2198,7 +2198,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2198
2198
}
2199
2199
2200
2200
CastKind :: Pointer ( PointerCast :: ArrayToPointer ) => {
2201
- let ty_from = op. ty ( body. body ( ) , tcx) ;
2201
+ let ty_from = op. ty ( & * body, tcx) ;
2202
2202
2203
2203
let opt_ty_elem = match ty_from. kind {
2204
2204
ty:: RawPtr (
@@ -2260,7 +2260,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2260
2260
}
2261
2261
2262
2262
CastKind :: Misc => {
2263
- let ty_from = op. ty ( body. body ( ) , tcx) ;
2263
+ let ty_from = op. ty ( & * body, tcx) ;
2264
2264
let cast_ty_from = CastTy :: from_ty ( ty_from) ;
2265
2265
let cast_ty_to = CastTy :: from_ty ( ty) ;
2266
2266
match ( cast_ty_from, cast_ty_to) {
@@ -2327,9 +2327,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2327
2327
| Rvalue :: BinaryOp ( BinOp :: Le , left, right)
2328
2328
| Rvalue :: BinaryOp ( BinOp :: Gt , left, right)
2329
2329
| Rvalue :: BinaryOp ( BinOp :: Ge , left, right) => {
2330
- let ty_left = left. ty ( body. body ( ) , tcx) ;
2330
+ let ty_left = left. ty ( & * body, tcx) ;
2331
2331
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) ;
2333
2333
let common_ty = self . infcx . next_ty_var (
2334
2334
TypeVariableOrigin {
2335
2335
kind : TypeVariableOriginKind :: MiscVariable ,
0 commit comments