@@ -29,15 +29,6 @@ pub trait InferCtxtExt<'tcx> {
2929 opaque_defn : & OpaqueTypeDecl < ' tcx > ,
3030 ) ;
3131
32- /*private*/
33- fn generate_member_constraint (
34- & self ,
35- concrete_ty : Ty < ' tcx > ,
36- opaque_defn : & OpaqueTypeDecl < ' tcx > ,
37- opaque_type_key : OpaqueTypeKey < ' tcx > ,
38- first_own_region_index : usize ,
39- ) ;
40-
4132 fn infer_opaque_definition_from_instantiation (
4233 & self ,
4334 opaque_type_key : OpaqueTypeKey < ' tcx > ,
@@ -285,31 +276,13 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
285276 hir:: OpaqueTyOrigin :: TyAlias => 0 ,
286277 } ;
287278
288- // The regions that appear in the hidden type must be equal to
289- // one of the regions in scope for the opaque type.
290- self . generate_member_constraint (
291- concrete_ty,
292- opaque_defn,
293- opaque_type_key,
294- first_own_region,
295- ) ;
296- }
279+ // For a case like `impl Foo<'a, 'b>`, we would generate a constraint
280+ // `'r in ['a, 'b, 'static]` for each region `'r` that appears in the
281+ // hidden type (i.e., it must be equal to `'a`, `'b`, or `'static`).
282+ //
283+ // `conflict1` and `conflict2` are the two region bounds that we
284+ // detected which were unrelated. They are used for diagnostics.
297285
298- /// As a fallback, we sometimes generate an "in constraint". For
299- /// a case like `impl Foo<'a, 'b>`, where `'a` and `'b` cannot be
300- /// related, we would generate a constraint `'r in ['a, 'b,
301- /// 'static]` for each region `'r` that appears in the hidden type
302- /// (i.e., it must be equal to `'a`, `'b`, or `'static`).
303- ///
304- /// `conflict1` and `conflict2` are the two region bounds that we
305- /// detected which were unrelated. They are used for diagnostics.
306- fn generate_member_constraint (
307- & self ,
308- concrete_ty : Ty < ' tcx > ,
309- opaque_defn : & OpaqueTypeDecl < ' tcx > ,
310- opaque_type_key : OpaqueTypeKey < ' tcx > ,
311- first_own_region : usize ,
312- ) {
313286 // Create the set of choice regions: each region in the hidden
314287 // type can be equal to any of the region parameters of the
315288 // opaque type definition.
0 commit comments