@@ -1182,7 +1182,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
11821182 }
11831183
11841184 /// 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.
11861186 ///
11871187 /// The type `revealed_ty` contains the same type as `anon_ty`, but with the
11881188 /// hidden types for impl traits revealed.
@@ -1210,12 +1210,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
12101210 /// generics of `foo`). Note that `anon_ty` is not just the opaque type,
12111211 /// but the entire return type (which may contain opaque types within it).
12121212 /// * `revealed_ty` would be `Box<(T, u32)>`
1213- /// * `anon_owner_def_id` would be the def-id of `foo`
12141213 fn eq_opaque_type_and_type (
12151214 & mut self ,
12161215 revealed_ty : Ty < ' tcx > ,
12171216 anon_ty : Ty < ' tcx > ,
1218- anon_owner_def_id : LocalDefId ,
12191217 locations : Locations ,
12201218 category : ConstraintCategory ,
12211219 ) -> Fallible < ( ) > {
@@ -1245,12 +1243,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
12451243 let tcx = infcx. tcx ;
12461244 let param_env = self . param_env ;
12471245 let body = self . body ;
1246+ let mir_def_id = body. source . def_id ( ) . expect_local ( ) ;
12481247
12491248 // 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 ;
12511250 let mut opaque_type_values = VecMap :: new ( ) ;
12521251
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 ) ;
12541253 let opaque_type_map = self . fully_perform_op (
12551254 locations,
12561255 category,
@@ -1268,7 +1267,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
12681267 // any generic parameters.)
12691268 let ( output_ty, opaque_type_map) =
12701269 obligations. add ( infcx. instantiate_opaque_types (
1271- anon_owner_def_id ,
1270+ mir_def_id ,
12721271 dummy_body_id,
12731272 param_env,
12741273 anon_ty,
0 commit comments