about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2018-09-19 11:07:43 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-09-19 11:07:43 +0300
commit046482e95e1b01a7f2ef01ffb7592db5045ad508 (patch)
treeb7bc189432b5b54336b7d9b793d97ea4257e9c0c
parentff6422d7a392acfc8af28994d65af2bbaecea4f6 (diff)
downloadrust-046482e95e1b01a7f2ef01ffb7592db5045ad508.tar.gz
rust-046482e95e1b01a7f2ef01ffb7592db5045ad508.zip
rustc: future-proof error reporting for polymorphic constants in types.
-rw-r--r--src/librustc/traits/error_reporting.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs
index 466d472cca3..44e99e182a9 100644
--- a/src/librustc/traits/error_reporting.rs
+++ b/src/librustc/traits/error_reporting.rs
@@ -846,7 +846,11 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
                     "could not evaluate constant expression",
                 ) {
                     Some(err) => err,
-                    None => return,
+                    None => {
+                        self.tcx.sess.delay_span_bug(span,
+                            &format!("constant in type had an ignored error: {:?}", err));
+                        return;
+                    }
                 }
             }