Use emit_inference_failure_err for ConstEvaluatable predicates

This commit is contained in:
Katherine Philip 2022-07-13 09:42:25 -07:00
parent adaddb5bab
commit 82ab171673

View File

@ -2156,6 +2156,22 @@ fn maybe_report_ambiguity(
}
}
ty::PredicateKind::ConstEvaluatable(data) => {
let subst = data.substs.iter().find(|g| g.has_infer_types_or_consts());
if let Some(subst) = subst {
let mut err = self.emit_inference_failure_err(
body_id,
span,
subst,
ErrorCode::E0284,
true,
);
err.note(&format!("cannot satisfy `{}`", predicate));
err
} else {
todo!();
}
}
_ => {
if self.tcx.sess.has_errors().is_some() || self.is_tainted_by_errors() {
return;