Skip to content

Commit 6e53aff

Browse files
committed
Remove imports in queries only used by define_callbacks!
1 parent da87244 commit 6e53aff

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

compiler/rustc_middle/src/queries.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ use rustc_index::IndexVec;
8888
use rustc_lint_defs::LintId;
8989
use rustc_macros::rustc_queries;
9090
use rustc_query_system::ich::StableHashingContext;
91-
use rustc_query_system::query::{QueryMode, QueryState};
9291
use rustc_session::Limits;
9392
use rustc_session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion};
9493
use rustc_session::cstore::{
@@ -119,10 +118,8 @@ use crate::mir::interpret::{
119118
use crate::mir::mono::{
120119
CodegenUnit, CollectionMode, MonoItem, MonoItemPartitions, NormalizationErrorInMono,
121120
};
122-
use crate::query::plumbing::{
123-
CyclePlaceholder, IntoQueryParam, TyCtxtAt, TyCtxtEnsureDone, TyCtxtEnsureOk,
124-
};
125-
use crate::query::{AsLocalKey, describe_as_module};
121+
use crate::query::describe_as_module;
122+
use crate::query::plumbing::CyclePlaceholder;
126123
use crate::traits::query::{
127124
CanonicalAliasGoal, CanonicalDropckOutlivesGoal, CanonicalImpliedOutlivesBoundsGoal,
128125
CanonicalMethodAutoderefStepsGoal, CanonicalPredicateGoal, CanonicalTypeOpAscribeUserTypeGoal,

compiler/rustc_middle/src/query/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rustc_hir::def_id::LocalDefId;
2+
pub use rustc_query_system::query::{QueryMode, QueryState};
23

34
pub use self::keys::{AsLocalKey, Key, LocalCrate};
45
pub use self::plumbing::{IntoQueryParam, TyCtxtAt, TyCtxtEnsureDone, TyCtxtEnsureOk};

compiler/rustc_middle/src/query/plumbing.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ macro_rules! query_ensure_select {
189189
}
190190

191191
macro_rules! query_helper_param_ty {
192-
(DefId) => { impl IntoQueryParam<DefId> };
193-
(LocalDefId) => { impl IntoQueryParam<LocalDefId> };
192+
(DefId) => { impl $crate::query::IntoQueryParam<DefId> };
193+
(LocalDefId) => { impl $crate::query::IntoQueryParam<LocalDefId> };
194194
($K:ty) => { $K };
195195
}
196196

@@ -213,7 +213,7 @@ macro_rules! local_key_if_separate_extern {
213213
$($K)*
214214
};
215215
([(separate_provide_extern) $($rest:tt)*] $($K:tt)*) => {
216-
<$($K)* as AsLocalKey>::LocalKey
216+
<$($K)* as $crate::query::AsLocalKey>::LocalKey
217217
};
218218
([$other:tt $($modifiers:tt)*] $($K:tt)*) => {
219219
local_key_if_separate_extern!([$($modifiers)*] $($K)*)
@@ -370,7 +370,7 @@ macro_rules! define_callbacks {
370370
$($(#[$attr])* pub $name: $name::Storage<'tcx>,)*
371371
}
372372

373-
impl<'tcx> TyCtxtEnsureOk<'tcx> {
373+
impl<'tcx> $crate::query::TyCtxtEnsureOk<'tcx> {
374374
$($(#[$attr])*
375375
#[inline(always)]
376376
pub fn $name(
@@ -382,21 +382,21 @@ macro_rules! define_callbacks {
382382
self.tcx,
383383
self.tcx.query_system.fns.engine.$name,
384384
&self.tcx.query_system.caches.$name,
385-
key.into_query_param(),
385+
$crate::query::IntoQueryParam::into_query_param(key),
386386
false,
387387
)
388388
})*
389389
}
390390

391-
impl<'tcx> TyCtxtEnsureDone<'tcx> {
391+
impl<'tcx> $crate::query::TyCtxtEnsureDone<'tcx> {
392392
$($(#[$attr])*
393393
#[inline(always)]
394394
pub fn $name(self, key: query_helper_param_ty!($($K)*)) {
395395
crate::query::inner::query_ensure(
396396
self.tcx,
397397
self.tcx.query_system.fns.engine.$name,
398398
&self.tcx.query_system.caches.$name,
399-
key.into_query_param(),
399+
$crate::query::IntoQueryParam::into_query_param(key),
400400
true,
401401
);
402402
})*
@@ -412,7 +412,7 @@ macro_rules! define_callbacks {
412412
})*
413413
}
414414

415-
impl<'tcx> TyCtxtAt<'tcx> {
415+
impl<'tcx> $crate::query::TyCtxtAt<'tcx> {
416416
$($(#[$attr])*
417417
#[inline(always)]
418418
pub fn $name(self, key: query_helper_param_ty!($($K)*)) -> $V
@@ -424,7 +424,7 @@ macro_rules! define_callbacks {
424424
self.tcx.query_system.fns.engine.$name,
425425
&self.tcx.query_system.caches.$name,
426426
self.span,
427-
key.into_query_param(),
427+
$crate::query::IntoQueryParam::into_query_param(key),
428428
))
429429
})*
430430
}
@@ -441,7 +441,7 @@ macro_rules! define_callbacks {
441441
#[derive(Default)]
442442
pub struct QueryStates<'tcx> {
443443
$(
444-
pub $name: QueryState<'tcx, $($K)*>,
444+
pub $name: $crate::query::QueryState<'tcx, $($K)*>,
445445
)*
446446
}
447447

@@ -487,7 +487,7 @@ macro_rules! define_callbacks {
487487
TyCtxt<'tcx>,
488488
Span,
489489
$name::Key<'tcx>,
490-
QueryMode,
490+
$crate::query::QueryMode,
491491
) -> Option<$crate::query::erase::Erased<$V>>,)*
492492
}
493493
};
@@ -507,7 +507,7 @@ macro_rules! hash_result {
507507

508508
macro_rules! define_feedable {
509509
($($(#[$attr:meta])* [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
510-
$(impl<'tcx, K: IntoQueryParam<$($K)*> + Copy> TyCtxtFeed<'tcx, K> {
510+
$(impl<'tcx, K: $crate::query::IntoQueryParam<$($K)*> + Copy> TyCtxtFeed<'tcx, K> {
511511
$(#[$attr])*
512512
#[inline(always)]
513513
pub fn $name(self, value: $name::ProvidedValue<'tcx>) {

0 commit comments

Comments
 (0)