1
Fork 0

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

@ -102,7 +102,7 @@ where
/// Assemble additional assumptions for an alias that are not included
/// in the item bounds of the alias. For now, this is limited to the
/// `implied_const_bounds` for an associated type.
/// `explicit_implied_const_bounds` for an associated type.
fn consider_additional_alias_assumptions(
ecx: &mut EvalCtxt<'_, D>,
goal: Goal<I, Self>,

View file

@ -84,12 +84,9 @@ where
let cx = ecx.cx();
let mut candidates = vec![];
// FIXME(const_trait_impl): We elaborate here because the implied const bounds
// aren't necessarily elaborated. We probably should prefix this query
// with `explicit_`...
for clause in elaborate::elaborate(
cx,
cx.implied_const_bounds(alias_ty.def_id)
cx.explicit_implied_const_bounds(alias_ty.def_id)
.iter_instantiated(cx, alias_ty.args)
.map(|trait_ref| trait_ref.to_host_effect_clause(cx, goal.predicate.constness)),
) {