diff options
| author | Katherine Philip <kurerunoshikaku@yahoo.com> | 2022-07-13 09:42:25 -0700 |
|---|---|---|
| committer | Katherine Philip <kurerunoshikaku@yahoo.com> | 2022-07-13 16:29:00 -0700 |
| commit | 82ab171673d10f16c67a52d50ef1f5b197656bbd (patch) | |
| tree | 84117329b4cb49003d09568cf9a47406aa0286b4 /compiler/rustc_trait_selection/src/traits | |
| parent | adaddb5bab936250535665fe1e7c6982d03352cb (diff) | |
| download | rust-82ab171673d10f16c67a52d50ef1f5b197656bbd.tar.gz rust-82ab171673d10f16c67a52d50ef1f5b197656bbd.zip | |
Use emit_inference_failure_err for ConstEvaluatable predicates
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index aa1c9136289..8396df4a243 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -2156,6 +2156,22 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> { } } + 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; |
