Rollup merge of #111625 - Zoxc:rustc_middle-query-move, r=cjgillot
Move rustc_middle/src/ty/query.rs to rustc_middle/src/query/plumbing.rs This just keeps the query modules together. r? `@cjgillot`
This commit is contained in:
commit
3df55382d4
@ -3,7 +3,8 @@ use std::fmt;
|
||||
|
||||
use rustc_errors::Diagnostic;
|
||||
use rustc_middle::mir::AssertKind;
|
||||
use rustc_middle::ty::{layout::LayoutError, query::TyCtxtAt, ConstInt};
|
||||
use rustc_middle::query::TyCtxtAt;
|
||||
use rustc_middle::ty::{layout::LayoutError, ConstInt};
|
||||
use rustc_span::{Span, Symbol};
|
||||
|
||||
use super::InterpCx;
|
||||
|
@ -8,13 +8,12 @@ use rustc_hir::{self as hir, def_id::DefId, definitions::DefPathData};
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::mir::interpret::{ErrorHandled, InterpError, ReportedErrorInfo};
|
||||
use rustc_middle::query::TyCtxtAt;
|
||||
use rustc_middle::ty::layout::{
|
||||
self, FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOf, LayoutOfHelpers,
|
||||
TyAndLayout,
|
||||
};
|
||||
use rustc_middle::ty::{
|
||||
self, query::TyCtxtAt, subst::SubstsRef, ParamEnv, Ty, TyCtxt, TypeFoldable,
|
||||
};
|
||||
use rustc_middle::ty::{self, subst::SubstsRef, ParamEnv, Ty, TyCtxt, TypeFoldable};
|
||||
use rustc_mir_dataflow::storage::always_storage_live_locals;
|
||||
use rustc_session::Limit;
|
||||
use rustc_span::Span;
|
||||
|
@ -95,7 +95,6 @@ pub mod middle;
|
||||
pub mod mir;
|
||||
pub mod thir;
|
||||
pub mod traits;
|
||||
#[macro_use]
|
||||
pub mod ty;
|
||||
pub mod util;
|
||||
mod values;
|
||||
|
@ -1,7 +1,8 @@
|
||||
use super::{AllocId, AllocRange, ConstAlloc, Pointer, Scalar};
|
||||
|
||||
use crate::mir::interpret::ConstValue;
|
||||
use crate::ty::{layout, query::TyCtxtAt, tls, Ty, ValTree};
|
||||
use crate::query::TyCtxtAt;
|
||||
use crate::ty::{layout, tls, Ty, ValTree};
|
||||
|
||||
use rustc_data_structures::sync::Lock;
|
||||
use rustc_errors::{pluralize, struct_span_err, DiagnosticBuilder, ErrorGuaranteed};
|
||||
|
@ -1,9 +1,10 @@
|
||||
use super::{ErrorHandled, EvalToConstValueResult, EvalToValTreeResult, GlobalId};
|
||||
|
||||
use crate::mir;
|
||||
use crate::query::{TyCtxtAt, TyCtxtEnsure};
|
||||
use crate::ty::subst::InternalSubsts;
|
||||
use crate::ty::visit::TypeVisitableExt;
|
||||
use crate::ty::{self, query::TyCtxtAt, query::TyCtxtEnsure, TyCtxt};
|
||||
use crate::ty::{self, TyCtxt};
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_session::lint;
|
||||
|
@ -25,6 +25,7 @@ use crate::mir::interpret::{
|
||||
use crate::mir::interpret::{LitToConstError, LitToConstInput};
|
||||
use crate::mir::mono::CodegenUnit;
|
||||
use crate::query::erase::{erase, restore, Erase};
|
||||
use crate::query::plumbing::{query_ensure, query_get_at, DynamicQuery};
|
||||
use crate::thir;
|
||||
use crate::traits::query::{
|
||||
CanonicalPredicateGoal, CanonicalProjectionGoal, CanonicalTyGoal,
|
||||
@ -39,10 +40,6 @@ use crate::traits::specialization_graph;
|
||||
use crate::traits::{self, ImplSource};
|
||||
use crate::ty::fast_reject::SimplifiedType;
|
||||
use crate::ty::layout::ValidityRequirement;
|
||||
use crate::ty::query::{
|
||||
query_ensure, query_get_at, DynamicQuery, IntoQueryParam, TyCtxtAt, TyCtxtEnsure,
|
||||
TyCtxtEnsureWithValue,
|
||||
};
|
||||
use crate::ty::subst::{GenericArg, SubstsRef};
|
||||
use crate::ty::util::AlwaysRequiresDrop;
|
||||
use crate::ty::GeneratorDiagnosticData;
|
||||
@ -90,8 +87,11 @@ use std::sync::Arc;
|
||||
|
||||
pub mod erase;
|
||||
mod keys;
|
||||
pub mod on_disk_cache;
|
||||
pub use keys::{AsLocalKey, Key, LocalCrate};
|
||||
pub mod on_disk_cache;
|
||||
#[macro_use]
|
||||
pub mod plumbing;
|
||||
pub use plumbing::{IntoQueryParam, TyCtxtAt, TyCtxtEnsure, TyCtxtEnsureWithValue};
|
||||
|
||||
// Each of these queries corresponds to a function pointer field in the
|
||||
// `Providers` struct for requesting a value of that type, and a method
|
||||
|
@ -14,14 +14,14 @@ use crate::middle::resolve_bound_vars;
|
||||
use crate::middle::stability;
|
||||
use crate::mir::interpret::{self, Allocation, ConstAllocation};
|
||||
use crate::mir::{Body, Local, Place, PlaceElem, ProjectionKind, Promoted};
|
||||
use crate::query::plumbing::QuerySystem;
|
||||
use crate::query::LocalCrate;
|
||||
use crate::query::Providers;
|
||||
use crate::query::{IntoQueryParam, TyCtxtAt};
|
||||
use crate::thir::Thir;
|
||||
use crate::traits;
|
||||
use crate::traits::solve;
|
||||
use crate::traits::solve::{ExternalConstraints, ExternalConstraintsData};
|
||||
use crate::ty::query::QuerySystem;
|
||||
use crate::ty::query::{self, TyCtxtAt};
|
||||
use crate::ty::{
|
||||
self, AdtDef, AdtDefData, AdtKind, Binder, Const, ConstData, FloatTy, FloatVar, FloatVid,
|
||||
GenericParamDefKind, ImplPolarity, InferTy, IntTy, IntVar, IntVid, List, ParamConst, ParamTy,
|
||||
@ -80,8 +80,6 @@ use std::iter;
|
||||
use std::mem;
|
||||
use std::ops::{Bound, Deref};
|
||||
|
||||
use super::query::IntoQueryParam;
|
||||
|
||||
const TINY_CONST_EVAL_LIMIT: Limit = Limit(20);
|
||||
|
||||
#[allow(rustc::usage_of_ty_tykind)]
|
||||
@ -512,7 +510,7 @@ pub struct GlobalCtxt<'tcx> {
|
||||
|
||||
untracked: Untracked,
|
||||
|
||||
pub query_system: query::QuerySystem<'tcx>,
|
||||
pub query_system: QuerySystem<'tcx>,
|
||||
pub(crate) query_kinds: &'tcx [DepKindStruct<'tcx>],
|
||||
|
||||
// Internal caches for metadata decoding. No need to track deps on this.
|
||||
|
@ -1,7 +1,7 @@
|
||||
use super::{GlobalCtxt, TyCtxt};
|
||||
|
||||
use crate::dep_graph::TaskDepsRef;
|
||||
use crate::ty::query;
|
||||
use crate::query::plumbing::QueryJobId;
|
||||
use rustc_data_structures::sync::{self, Lock};
|
||||
use rustc_errors::Diagnostic;
|
||||
#[cfg(not(parallel_compiler))]
|
||||
@ -22,7 +22,7 @@ pub struct ImplicitCtxt<'a, 'tcx> {
|
||||
|
||||
/// The current query job, if any. This is updated by `JobOwner::start` in
|
||||
/// `ty::query::plumbing` when executing a query.
|
||||
pub query: Option<query::QueryJobId>,
|
||||
pub query: Option<QueryJobId>,
|
||||
|
||||
/// Where to store diagnostics for the current query job, if any.
|
||||
/// This is updated by `JobOwner::start` in `ty::query::plumbing` when executing a query.
|
||||
|
@ -1,5 +1,6 @@
|
||||
use crate::fluent_generated as fluent;
|
||||
use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||
use crate::query::TyCtxtAt;
|
||||
use crate::ty::normalize_erasing_regions::NormalizationError;
|
||||
use crate::ty::{self, ReprOptions, Ty, TyCtxt, TypeVisitableExt};
|
||||
use rustc_errors::{DiagnosticBuilder, Handler, IntoDiagnostic};
|
||||
@ -543,20 +544,20 @@ impl<'tcx> HasTyCtxt<'tcx> for TyCtxt<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HasDataLayout for ty::query::TyCtxtAt<'tcx> {
|
||||
impl<'tcx> HasDataLayout for TyCtxtAt<'tcx> {
|
||||
#[inline]
|
||||
fn data_layout(&self) -> &TargetDataLayout {
|
||||
&self.data_layout
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HasTargetSpec for ty::query::TyCtxtAt<'tcx> {
|
||||
impl<'tcx> HasTargetSpec for TyCtxtAt<'tcx> {
|
||||
fn target_spec(&self) -> &Target {
|
||||
&self.sess.target
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HasTyCtxt<'tcx> for ty::query::TyCtxtAt<'tcx> {
|
||||
impl<'tcx> HasTyCtxt<'tcx> for TyCtxtAt<'tcx> {
|
||||
#[inline]
|
||||
fn tcx(&self) -> TyCtxt<'tcx> {
|
||||
**self
|
||||
@ -683,7 +684,7 @@ impl<'tcx> LayoutOfHelpers<'tcx> for LayoutCx<'tcx, TyCtxt<'tcx>> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> LayoutOfHelpers<'tcx> for LayoutCx<'tcx, ty::query::TyCtxtAt<'tcx>> {
|
||||
impl<'tcx> LayoutOfHelpers<'tcx> for LayoutCx<'tcx, TyCtxtAt<'tcx>> {
|
||||
type LayoutOfResult = Result<TyAndLayout<'tcx>, LayoutError<'tcx>>;
|
||||
|
||||
#[inline]
|
||||
|
@ -122,8 +122,6 @@ pub mod inhabitedness;
|
||||
pub mod layout;
|
||||
pub mod normalize_erasing_regions;
|
||||
pub mod print;
|
||||
#[macro_use]
|
||||
pub mod query;
|
||||
pub mod relate;
|
||||
pub mod subst;
|
||||
pub mod trait_def;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::mir::interpret::{AllocRange, GlobalAlloc, Pointer, Provenance, Scalar};
|
||||
use crate::query::IntoQueryParam;
|
||||
use crate::query::Providers;
|
||||
use crate::ty::query::IntoQueryParam;
|
||||
use crate::ty::{
|
||||
self, ConstInt, ParamConst, ScalarInt, Term, TermKind, Ty, TyCtxt, TypeFoldable,
|
||||
TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, TypeVisitableExt,
|
||||
|
@ -185,9 +185,9 @@ use rustc_middle::mir::interpret::{ErrorHandled, GlobalAlloc, Scalar};
|
||||
use rustc_middle::mir::mono::{InstantiationMode, MonoItem};
|
||||
use rustc_middle::mir::visit::Visitor as MirVisitor;
|
||||
use rustc_middle::mir::{self, Local, Location};
|
||||
use rustc_middle::query::TyCtxtAt;
|
||||
use rustc_middle::ty::adjustment::{CustomCoerceUnsized, PointerCast};
|
||||
use rustc_middle::ty::print::with_no_trimmed_paths;
|
||||
use rustc_middle::ty::query::TyCtxtAt;
|
||||
use rustc_middle::ty::subst::{GenericArgKind, InternalSubsts};
|
||||
use rustc_middle::ty::{
|
||||
self, GenericParamDefKind, Instance, InstanceDef, Ty, TyCtxt, TypeFoldable, TypeVisitableExt,
|
||||
|
@ -12,10 +12,9 @@ extern crate rustc_middle;
|
||||
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::query::{Providers, TyCtxtAt};
|
||||
use rustc_middle::traits;
|
||||
use rustc_middle::ty::adjustment::CustomCoerceUnsized;
|
||||
use rustc_middle::ty::query::TyCtxtAt;
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
|
||||
mod collector;
|
||||
|
@ -24,12 +24,12 @@ use rustc_middle::dep_graph::DepNodeIndex;
|
||||
use rustc_middle::dep_graph::{self, DepKind, DepKindStruct};
|
||||
use rustc_middle::query::erase::{erase, restore, Erase};
|
||||
use rustc_middle::query::on_disk_cache::OnDiskCache;
|
||||
use rustc_middle::query::plumbing::{DynamicQuery, QuerySystem, QuerySystemFns};
|
||||
use rustc_middle::query::AsLocalKey;
|
||||
use rustc_middle::query::{
|
||||
query_keys, query_provided, query_provided_to_value, query_storage, query_values,
|
||||
DynamicQueries, ExternProviders, Providers, QueryCaches, QueryEngine, QueryStates,
|
||||
};
|
||||
use rustc_middle::ty::query::{DynamicQuery, QuerySystem, QuerySystemFns};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_query_system::dep_graph::SerializedDepNodeIndex;
|
||||
use rustc_query_system::ich::StableHashingContext;
|
||||
|
@ -716,8 +716,7 @@ macro_rules! define_queries {
|
||||
|
||||
mod query_structs {
|
||||
use super::*;
|
||||
use rustc_middle::ty::query::QueryStruct;
|
||||
use rustc_middle::ty::query::QueryKeyStringCache;
|
||||
use rustc_middle::query::plumbing::{QueryKeyStringCache, QueryStruct};
|
||||
use rustc_middle::dep_graph::DepKind;
|
||||
use crate::QueryConfigRestored;
|
||||
|
||||
|
@ -2,7 +2,7 @@ use measureme::{StringComponent, StringId};
|
||||
use rustc_data_structures::profiling::SelfProfiler;
|
||||
use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, LOCAL_CRATE};
|
||||
use rustc_hir::definitions::DefPathData;
|
||||
use rustc_middle::ty::query::QueryKeyStringCache;
|
||||
use rustc_middle::query::plumbing::QueryKeyStringCache;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_query_system::query::QueryCache;
|
||||
use std::fmt::Debug;
|
||||
|
Loading…
x
Reference in New Issue
Block a user