diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-11 18:07:03 +0000 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-11-12 10:03:28 +0000 |
| commit | 49a5aa4f0cd2e21f071067e7a0c53474ba9e86c6 (patch) | |
| tree | bec1baf802c6cba07c62596ddb0c9d55ac9adc12 | |
| parent | da9dca704003df6fcc85a535aa578b42b13de590 (diff) | |
| download | rust-49a5aa4f0cd2e21f071067e7a0c53474ba9e86c6.tar.gz rust-49a5aa4f0cd2e21f071067e7a0c53474ba9e86c6.zip | |
Verify predicates on RPIT and async opaques.
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect/predicates_of.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs index 5d1ca1cbd23..5f4127632e3 100644 --- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs @@ -107,26 +107,6 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP *generics } ItemKind::OpaqueTy(OpaqueTy { - origin: hir::OpaqueTyOrigin::AsyncFn(..) | hir::OpaqueTyOrigin::FnReturn(..), - .. - }) => { - // return-position impl trait - // - // We don't inherit predicates from the parent here: - // If we have, say `fn f<'a, T: 'a>() -> impl Sized {}` - // then the return type is `f::<'static, T>::{{opaque}}`. - // - // If we inherited the predicates of `f` then we would - // require that `T: 'static` to show that the return - // type is well-formed. - // - // The only way to have something with this opaque type - // is from the return type of the containing function, - // which will ensure that the function's predicates - // hold. - return ty::GenericPredicates { parent: None, predicates: &[] }; - } - ItemKind::OpaqueTy(OpaqueTy { ref generics, origin: hir::OpaqueTyOrigin::TyAlias, .. |
