about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorKatherine Philip <kurerunoshikaku@yahoo.com>2022-07-13 09:42:25 -0700
committerKatherine Philip <kurerunoshikaku@yahoo.com>2022-07-13 16:29:00 -0700
commit82ab171673d10f16c67a52d50ef1f5b197656bbd (patch)
tree84117329b4cb49003d09568cf9a47406aa0286b4 /compiler/rustc_trait_selection/src
parentadaddb5bab936250535665fe1e7c6982d03352cb (diff)
downloadrust-82ab171673d10f16c67a52d50ef1f5b197656bbd.tar.gz
rust-82ab171673d10f16c67a52d50ef1f5b197656bbd.zip
Use emit_inference_failure_err for ConstEvaluatable predicates
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs16
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;