@@ -1182,7 +1182,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1182
1182
}
1183
1183
1184
1184
/// Equates a type `anon_ty` that may contain opaque types whose
1185
- /// values are to be inferred by the MIR with def-id `anon_owner_def_id` .
1185
+ /// values are to be inferred by the MIR.
1186
1186
///
1187
1187
/// The type `revealed_ty` contains the same type as `anon_ty`, but with the
1188
1188
/// hidden types for impl traits revealed.
@@ -1210,12 +1210,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1210
1210
/// generics of `foo`). Note that `anon_ty` is not just the opaque type,
1211
1211
/// but the entire return type (which may contain opaque types within it).
1212
1212
/// * `revealed_ty` would be `Box<(T, u32)>`
1213
- /// * `anon_owner_def_id` would be the def-id of `foo`
1214
1213
fn eq_opaque_type_and_type (
1215
1214
& mut self ,
1216
1215
revealed_ty : Ty < ' tcx > ,
1217
1216
anon_ty : Ty < ' tcx > ,
1218
- anon_owner_def_id : LocalDefId ,
1219
1217
locations : Locations ,
1220
1218
category : ConstraintCategory ,
1221
1219
) -> Fallible < ( ) > {
@@ -1245,12 +1243,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1245
1243
let tcx = infcx. tcx ;
1246
1244
let param_env = self . param_env ;
1247
1245
let body = self . body ;
1246
+ let mir_def_id = body. source . def_id ( ) . expect_local ( ) ;
1248
1247
1249
1248
// the "concrete opaque types" maps
1250
- let concrete_opaque_types = & tcx. typeck ( anon_owner_def_id ) . concrete_opaque_types ;
1249
+ let concrete_opaque_types = & tcx. typeck ( mir_def_id ) . concrete_opaque_types ;
1251
1250
let mut opaque_type_values = VecMap :: new ( ) ;
1252
1251
1253
- debug ! ( "eq_opaque_type_and_type: mir_def_id={:?}" , body . source . def_id ( ) ) ;
1252
+ debug ! ( "eq_opaque_type_and_type: mir_def_id={:?}" , mir_def_id ) ;
1254
1253
let opaque_type_map = self . fully_perform_op (
1255
1254
locations,
1256
1255
category,
@@ -1268,7 +1267,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1268
1267
// any generic parameters.)
1269
1268
let ( output_ty, opaque_type_map) =
1270
1269
obligations. add ( infcx. instantiate_opaque_types (
1271
- anon_owner_def_id ,
1270
+ mir_def_id ,
1272
1271
dummy_body_id,
1273
1272
param_env,
1274
1273
anon_ty,
0 commit comments