]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_infer/src/infer/opaque_types.rs
Rollup merge of #88375 - joshlf:patch-3, r=dtolnay
[rust.git] / compiler / rustc_infer / src / infer / opaque_types.rs
index e79ece9a4a4d556a41ed7a5c5b596431cb06a2f1..e7dca94806cb740243e7ab0af2c141a84635e2ce 100644 (file)
@@ -276,7 +276,7 @@ pub fn constrain_opaque_type(
         debug!(?concrete_ty);
 
         let first_own_region = match opaque_defn.origin {
-            hir::OpaqueTyOrigin::FnReturn(..) => {
+            hir::OpaqueTyOrigin::FnReturn(..) | hir::OpaqueTyOrigin::AsyncFn(..) => {
                 // We lower
                 //
                 // fn foo<'l0..'ln>() -> impl Trait<'l0..'lm>
@@ -291,7 +291,7 @@ pub fn constrain_opaque_type(
             }
             // These opaque type inherit all lifetime parameters from their
             // parent, so we have to check them all.
-            hir::OpaqueTyOrigin::AsyncFn(..) | hir::OpaqueTyOrigin::TyAlias => 0,
+            hir::OpaqueTyOrigin::TyAlias => 0,
         };
 
         // For a case like `impl Foo<'a, 'b>`, we would generate a constraint