Skip to content

Commit 82ab171

Browse files
committed
Use emit_inference_failure_err for ConstEvaluatable predicates
1 parent adaddb5 commit 82ab171

File tree

1 file changed

+16
-0
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+16
-0
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,6 +2156,22 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
21562156
}
21572157
}
21582158

2159+
ty::PredicateKind::ConstEvaluatable(data) => {
2160+
let subst = data.substs.iter().find(|g| g.has_infer_types_or_consts());
2161+
if let Some(subst) = subst {
2162+
let mut err = self.emit_inference_failure_err(
2163+
body_id,
2164+
span,
2165+
subst,
2166+
ErrorCode::E0284,
2167+
true,
2168+
);
2169+
err.note(&format!("cannot satisfy `{}`", predicate));
2170+
err
2171+
} else {
2172+
todo!();
2173+
}
2174+
}
21592175
_ => {
21602176
if self.tcx.sess.has_errors().is_some() || self.is_tainted_by_errors() {
21612177
return;

0 commit comments

Comments
 (0)