X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_const_eval%2Fsrc%2Flib.rs;h=1ab461a9421291ed788c7d36f37d728f5459b722;hb=496384531ea92e2efec8802e2d3b45b6ffff9bd8;hp=d688331ae0a56f569fac57467846e593a02164b6;hpb=2567d0f8837d351beba9c30545833fdf4bdc7054;p=rust.git diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs index d688331ae0a..1ab461a9421 100644 --- a/compiler/rustc_const_eval/src/lib.rs +++ b/compiler/rustc_const_eval/src/lib.rs @@ -5,7 +5,6 @@ */ #![feature(assert_matches)] -#![feature(bool_to_option)] #![feature(box_patterns)] #![feature(control_flow_enum)] #![feature(crate_visibility_modifier)] @@ -35,6 +34,7 @@ pub mod util; use rustc_middle::ty::query::Providers; +use rustc_middle::ty::ParamEnv; pub fn provide(providers: &mut Providers) { const_eval::provide(providers); @@ -49,6 +49,9 @@ pub fn provide(providers: &mut Providers) { let (param_env, raw) = param_env_and_value.into_parts(); const_eval::const_to_valtree(tcx, param_env, raw) }; + providers.valtree_to_const_val = |tcx, (ty, valtree)| { + const_eval::valtree_to_const_value(tcx, ParamEnv::empty().and(ty), valtree) + }; providers.deref_const = |tcx, param_env_and_value| { let (param_env, value) = param_env_and_value.into_parts(); const_eval::deref_const(tcx, param_env, value)