diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-09-22 16:26:20 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-09-22 16:26:20 +0000 |
| commit | 2ba911c8329a4a8b6697cc6a25c02f0f06d58d8d (patch) | |
| tree | 7659337027d83c1b09500dbe664db0092e1f887c /compiler/rustc_const_eval | |
| parent | 9defc971f1e059e139e8719661560de4741a128e (diff) | |
| download | rust-2ba911c8329a4a8b6697cc6a25c02f0f06d58d8d.tar.gz rust-2ba911c8329a4a8b6697cc6a25c02f0f06d58d8d.zip | |
Have a single struct for queries and hook
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs index 8ac2b519760..8bb409cea08 100644 --- a/compiler/rustc_const_eval/src/lib.rs +++ b/compiler/rustc_const_eval/src/lib.rs @@ -38,12 +38,11 @@ pub use errors::ReportErrorExt; use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; use rustc_fluent_macro::fluent_messages; -use rustc_middle::query::Providers; -use rustc_middle::{hooks, ty}; +use rustc_middle::{ty, util::Providers}; fluent_messages! { "../messages.ftl" } -pub fn provide(providers: &mut Providers, hooks: &mut hooks::Providers) { +pub fn provide(providers: &mut Providers) { const_eval::provide(providers); providers.eval_to_const_value_raw = const_eval::eval_to_const_value_raw_provider; providers.eval_to_allocation_raw = const_eval::eval_to_allocation_raw_provider; @@ -52,7 +51,7 @@ pub fn provide(providers: &mut Providers, hooks: &mut hooks::Providers) { let (param_env, raw) = param_env_and_value.into_parts(); const_eval::eval_to_valtree(tcx, param_env, raw) }; - hooks.try_destructure_mir_constant_for_diagnostics = + providers.hooks.try_destructure_mir_constant_for_diagnostics = const_eval::try_destructure_mir_constant_for_diagnostics; providers.valtree_to_const_val = |tcx, (ty, valtree)| { const_eval::valtree_to_const_value(tcx, ty::ParamEnv::empty().and(ty), valtree) |
