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

@ -339,6 +339,8 @@ fn check_opaque_meets_bounds<'tcx>(
let misc_cause = ObligationCause::misc(span, def_id);
// FIXME: We should just register the item bounds here, rather than equating.
// FIXME(const_trait_impl): When we do that, please make sure to also register
// the `~const` bounds.
match ocx.eq(&misc_cause, param_env, opaque_ty, hidden_ty) {
Ok(()) => {}
Err(ty_err) => {