Move abstract const to rustc_middle::ty

This commit is contained in:
kadmin 2022-07-09 09:35:06 +00:00
parent 8a3325496f
commit e612e2603c
22 changed files with 729 additions and 723 deletions

View file

@ -845,23 +845,9 @@ pub fn provide(providers: &mut ty::query::Providers) {
vtable_entries,
vtable_trait_upcasting_coercion_new_vptr_slot,
subst_and_check_impossible_predicates,
thir_abstract_const: |tcx, def_id| {
let def_id = def_id.expect_local();
if let Some(def) = ty::WithOptConstParam::try_lookup(def_id, tcx) {
tcx.thir_abstract_const_of_const_arg(def)
} else {
const_evaluatable::thir_abstract_const(tcx, ty::WithOptConstParam::unknown(def_id))
}
},
thir_abstract_const_of_const_arg: |tcx, (did, param_did)| {
const_evaluatable::thir_abstract_const(
tcx,
ty::WithOptConstParam { did, const_param_did: Some(param_did) },
)
},
try_unify_abstract_consts: |tcx, param_env_and| {
let (param_env, (a, b)) = param_env_and.into_parts();
const_evaluatable::try_unify_abstract_consts(tcx, (a, b), param_env)
rustc_middle::ty::abstract_const::try_unify_abstract_consts(tcx, (a, b), param_env)
},
..*providers
};