Add support for ~const item bounds

This commit is contained in:
Michael Goulet
2024-10-22 00:00:50 +00:00
parent 1d4a7670d4
commit 3bad5014c9
11 changed files with 191 additions and 25 deletions

View File

@@ -100,6 +100,15 @@ 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.
fn consider_additional_alias_assumptions(
ecx: &mut EvalCtxt<'_, D>,
goal: Goal<I, Self>,
alias_ty: ty::AliasTy<I>,
) -> Vec<Candidate<I>>;
fn consider_impl_candidate(
ecx: &mut EvalCtxt<'_, D>,
goal: Goal<I, Self>,
@@ -594,6 +603,8 @@ where
));
}
candidates.extend(G::consider_additional_alias_assumptions(self, goal, alias_ty));
if kind != ty::Projection {
return;
}