do not prefer substs relate during coherence

This commit is contained in:
lcnr 2023-05-26 10:59:01 +02:00
parent c86212f9bc
commit e7fa993d89

View File

@ -265,14 +265,22 @@ enum Invert {
if let Some(merged) = self.try_merge_responses(&candidates) {
Ok(merged)
} else if let Ok(subst_relate_response) = subst_relate_response {
Ok(subst_relate_response)
} else {
// When relating two aliases and we have ambiguity, we prefer
// relating the generic arguments of the aliases over normalizing
// them. This is necessary for inference during typeck.
//
// As this is incomplete, we must not do so during coherence.
match (self.solver_mode(), subst_relate_response) {
(SolverMode::Normal, Ok(response)) => Ok(response),
(SolverMode::Normal, Err(NoSolution)) | (SolverMode::Coherence, _) => {
self.flounder(&candidates)
}
}
}
}
}
}
#[instrument(level = "debug", skip(self), ret)]
fn compute_const_arg_has_type_goal(