Skip to content

Commit 49a5aa4

Browse files
committed
Verify predicates on RPIT and async opaques.
1 parent da9dca7 commit 49a5aa4

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,6 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
106106
is_trait = Some(ty::TraitRef::identity(tcx, def_id));
107107
*generics
108108
}
109-
ItemKind::OpaqueTy(OpaqueTy {
110-
origin: hir::OpaqueTyOrigin::AsyncFn(..) | hir::OpaqueTyOrigin::FnReturn(..),
111-
..
112-
}) => {
113-
// return-position impl trait
114-
//
115-
// We don't inherit predicates from the parent here:
116-
// If we have, say `fn f<'a, T: 'a>() -> impl Sized {}`
117-
// then the return type is `f::<'static, T>::{{opaque}}`.
118-
//
119-
// If we inherited the predicates of `f` then we would
120-
// require that `T: 'static` to show that the return
121-
// type is well-formed.
122-
//
123-
// The only way to have something with this opaque type
124-
// is from the return type of the containing function,
125-
// which will ensure that the function's predicates
126-
// hold.
127-
return ty::GenericPredicates { parent: None, predicates: &[] };
128-
}
129109
ItemKind::OpaqueTy(OpaqueTy {
130110
ref generics,
131111
origin: hir::OpaqueTyOrigin::TyAlias,

0 commit comments

Comments
 (0)