summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_const_eval/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_const_eval/src/lib.rs')
-rw-r--r--compiler/rustc_const_eval/src/lib.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs
index c36282d5e..c126f749b 100644
--- a/compiler/rustc_const_eval/src/lib.rs
+++ b/compiler/rustc_const_eval/src/lib.rs
@@ -4,6 +4,7 @@ Rust MIR: a lowered representation of Rust.
*/
+#![deny(rustc::untranslatable_diagnostic)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(decl_macro)]
@@ -33,6 +34,8 @@ pub mod interpret;
pub mod transform;
pub mod util;
+pub use errors::ReportErrorExt;
+
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
use rustc_fluent_macro::fluent_messages;
use rustc_middle::query::Providers;
@@ -49,17 +52,11 @@ pub fn provide(providers: &mut Providers) {
let (param_env, raw) = param_env_and_value.into_parts();
const_eval::eval_to_valtree(tcx, param_env, raw)
};
- providers.try_destructure_mir_constant = |tcx, param_env_and_value| {
- let (param_env, value) = param_env_and_value.into_parts();
- const_eval::try_destructure_mir_constant(tcx, param_env, value).ok()
- };
+ providers.try_destructure_mir_constant_for_diagnostics =
+ |tcx, (cv, ty)| const_eval::try_destructure_mir_constant_for_diagnostics(tcx, cv, ty);
providers.valtree_to_const_val = |tcx, (ty, valtree)| {
const_eval::valtree_to_const_value(tcx, ty::ParamEnv::empty().and(ty), valtree)
};
- providers.deref_mir_constant = |tcx, param_env_and_value| {
- let (param_env, value) = param_env_and_value.into_parts();
- const_eval::deref_mir_constant(tcx, param_env, value)
- };
providers.check_validity_requirement = |tcx, (init_kind, param_env_and_ty)| {
util::check_validity_requirement(tcx, init_kind, param_env_and_ty)
};