Move expansion of query macros in rustc_middle to rustc_middle::query
This commit is contained in:
parent
a14d6961f9
commit
fff20a703d
102 changed files with 257 additions and 222 deletions
|
@ -26,6 +26,7 @@ use crate::infer::{InferCtxt, TyCtxtInferExt};
|
|||
use crate::traits::error_reporting::TypeErrCtxtExt as _;
|
||||
use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
|
||||
use rustc_errors::ErrorGuaranteed;
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::fold::TypeFoldable;
|
||||
use rustc_middle::ty::visit::{TypeVisitable, TypeVisitableExt};
|
||||
use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeSuperVisitable};
|
||||
|
@ -498,10 +499,10 @@ fn is_impossible_method(tcx: TyCtxt<'_>, (impl_def_id, trait_item_def_id): (DefI
|
|||
false
|
||||
}
|
||||
|
||||
pub fn provide(providers: &mut ty::query::Providers) {
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
object_safety::provide(providers);
|
||||
vtable::provide(providers);
|
||||
*providers = ty::query::Providers {
|
||||
*providers = Providers {
|
||||
specialization_graph_of: specialize::specialization_graph_provider,
|
||||
specializes: specialize::specializes,
|
||||
subst_and_check_impossible_predicates,
|
||||
|
|
|
@ -16,6 +16,7 @@ use crate::traits::{self, Obligation, ObligationCause};
|
|||
use rustc_errors::{DelayDm, FatalError, MultiSpan};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::subst::{GenericArg, InternalSubsts};
|
||||
use rustc_middle::ty::{
|
||||
self, EarlyBinder, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor,
|
||||
|
@ -947,7 +948,6 @@ pub fn contains_illegal_impl_trait_in_trait<'tcx>(
|
|||
})
|
||||
}
|
||||
|
||||
pub fn provide(providers: &mut ty::query::Providers) {
|
||||
*providers =
|
||||
ty::query::Providers { object_safety_violations, check_is_object_safe, ..*providers };
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
*providers = Providers { object_safety_violations, check_is_object_safe, ..*providers };
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ use rustc_hir::def_id::DefId;
|
|||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_infer::traits::util::PredicateSet;
|
||||
use rustc_infer::traits::ImplSource;
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::visit::TypeVisitableExt;
|
||||
use rustc_middle::ty::InternalSubsts;
|
||||
use rustc_middle::ty::{self, GenericParamDefKind, ToPredicate, Ty, TyCtxt, VtblEntry};
|
||||
|
@ -379,8 +380,8 @@ pub(crate) fn count_own_vtable_entries<'tcx>(
|
|||
tcx.own_existential_vtable_entries(trait_ref.def_id()).len()
|
||||
}
|
||||
|
||||
pub(super) fn provide(providers: &mut ty::query::Providers) {
|
||||
*providers = ty::query::Providers {
|
||||
pub(super) fn provide(providers: &mut Providers) {
|
||||
*providers = Providers {
|
||||
own_existential_vtable_entries,
|
||||
vtable_entries,
|
||||
vtable_trait_upcasting_coercion_new_vptr_slot,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue