Move impl constness into impl trait header

This commit is contained in:
Oli Scherer 2024-12-10 10:12:36 +00:00
parent c0e0d8f874
commit 2ffe3b1e70
8 changed files with 35 additions and 33 deletions

View file

@ -128,7 +128,9 @@ fn evaluate_host_effect_from_selection_candiate<'tcx>(
Err(_) => Err(EvaluationFailure::NoSolution),
Ok(Some(source)) => match source {
ImplSource::UserDefined(impl_) => {
if tcx.constness(impl_.impl_def_id) != hir::Constness::Const {
if tcx.impl_trait_header(impl_.impl_def_id).unwrap().constness
!= hir::Constness::Const
{
return Err(EvaluationFailure::NoSolution);
}