Rollup merge of #133218 - compiler-errors:const-opaque, r=fee1-dead

Implement `~const` item bounds in RPIT

an RPIT in a `const fn` is allowed to be conditionally const itself :)

r? fee1-dead or reroll
This commit is contained in:
Matthias Krüger 2024-11-21 07:56:13 +01:00 committed by GitHub
commit 920092531f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 144 additions and 31 deletions

View file

@ -393,12 +393,12 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
)
}
fn implied_const_bounds(
fn explicit_implied_const_bounds(
self,
def_id: DefId,
) -> ty::EarlyBinder<'tcx, impl IntoIterator<Item = ty::Binder<'tcx, ty::TraitRef<'tcx>>>> {
ty::EarlyBinder::bind(
self.implied_const_bounds(def_id).iter_identity_copied().map(|(c, _)| c),
self.explicit_implied_const_bounds(def_id).iter_identity_copied().map(|(c, _)| c),
)
}