Skip to content

Commit 1d34ba8

Browse files
committed
Rename QueryKeyId to TaggedQueryKey
1 parent 2242780 commit 1d34ba8

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

compiler/rustc_middle/src/query/plumbing.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -510,21 +510,21 @@ macro_rules! define_callbacks {
510510
/// Identifies a query by kind and key. This is in contrast to `QueryId` which is just a number.
511511
#[allow(non_camel_case_types)]
512512
#[derive(Clone, Debug)]
513-
pub enum QueryKeyId<'tcx> {
513+
pub enum TaggedQueryKey<'tcx> {
514514
$(
515515
$name($name::Key<'tcx>),
516516
)*
517517
}
518518

519-
impl<'tcx> QueryKeyId<'tcx> {
519+
impl<'tcx> TaggedQueryKey<'tcx> {
520520
/// Formats a human-readable description of this query and its key, as
521521
/// specified by the `desc` query modifier.
522522
///
523523
/// Used when reporting query cycle errors and similar problems.
524524
pub fn description(&self, tcx: TyCtxt<'tcx>) -> String {
525525
let (name, description) = ty::print::with_no_queries!(match self {
526526
$(
527-
QueryKeyId::$name(key) => (stringify!($name), _description_fns::$name(tcx, *key)),
527+
TaggedQueryKey::$name(key) => (stringify!($name), _description_fns::$name(tcx, *key)),
528528
)*
529529
});
530530
if tcx.sess.verbose_internals() {
@@ -539,14 +539,14 @@ macro_rules! define_callbacks {
539539
if !span.is_dummy() {
540540
return span
541541
}
542-
if let QueryKeyId::def_span(..) = self {
542+
if let TaggedQueryKey::def_span(..) = self {
543543
// The `def_span` query is used to calculate `default_span`,
544544
// so exit to avoid infinite recursion.
545545
return DUMMY_SP
546546
}
547547
match self {
548548
$(
549-
QueryKeyId::$name(key) => crate::query::QueryKey::default_span(key, tcx),
549+
TaggedQueryKey::$name(key) => crate::query::QueryKey::default_span(key, tcx),
550550
)*
551551
}
552552
}
@@ -556,13 +556,13 @@ macro_rules! define_callbacks {
556556
key.key_as_def_id().and_then(|def_id| def_id.as_local()).map(|def_id| tcx.def_kind(def_id))
557557
}
558558

559-
if let QueryKeyId::def_kind(..) = self {
559+
if let TaggedQueryKey::def_kind(..) = self {
560560
// Try to avoid infinite recursion.
561561
return None
562562
}
563563
match self {
564564
$(
565-
QueryKeyId::$name(key) => inner(key, tcx),
565+
TaggedQueryKey::$name(key) => inner(key, tcx),
566566
)*
567567
}
568568
}

compiler/rustc_middle/src/query/stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ use std::fmt::Debug;
33
use rustc_span::def_id::DefId;
44

55
use crate::dep_graph::DepKind;
6-
use crate::queries::QueryKeyId;
6+
use crate::queries::TaggedQueryKey;
77

88
/// Description of a frame in the query stack.
99
///
1010
/// This is mostly used in case of cycles for error reporting.
1111
#[derive(Clone, Debug)]
1212
pub struct QueryStackFrame<'tcx> {
13-
pub id: QueryKeyId<'tcx>,
13+
pub id: TaggedQueryKey<'tcx>,
1414
pub dep_kind: DepKind,
1515
pub def_id: Option<DefId>,
1616
/// A def-id that is extracted from a `Ty` in a query key

compiler/rustc_query_impl/src/execution.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_data_structures::sync::{DynSend, DynSync};
77
use rustc_data_structures::{outline, sharded, sync};
88
use rustc_errors::{FatalError, StashKey};
99
use rustc_middle::dep_graph::{DepGraphData, DepNodeKey, SerializedDepNodeIndex};
10-
use rustc_middle::queries::QueryKeyId;
10+
use rustc_middle::queries::TaggedQueryKey;
1111
use rustc_middle::query::plumbing::QueryVTable;
1212
use rustc_middle::query::{
1313
ActiveKeyStatus, CycleError, CycleErrorHandling, EnsureMode, QueryCache, QueryJob, QueryJobId,
@@ -41,7 +41,7 @@ pub(crate) fn all_inactive<'tcx, K>(state: &QueryState<'tcx, K>) -> bool {
4141
pub(crate) fn gather_active_jobs<'tcx, C>(
4242
query: &'tcx QueryVTable<'tcx, C>,
4343
require_complete: bool,
44-
make_id: fn(C::Key) -> QueryKeyId<'tcx>,
44+
make_id: fn(C::Key) -> TaggedQueryKey<'tcx>,
4545
job_map_out: &mut QueryJobMap<'tcx>, // Out-param; job info is gathered into this map
4646
) -> Option<()>
4747
where

compiler/rustc_query_impl/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use rustc_data_structures::sync::AtomicU64;
1212
use rustc_middle::dep_graph;
13-
use rustc_middle::queries::{self, ExternProviders, Providers, QueryKeyId};
13+
use rustc_middle::queries::{self, ExternProviders, Providers, TaggedQueryKey};
1414
use rustc_middle::query::on_disk_cache::{CacheEncoder, EncodedDepNodeIndex, OnDiskCache};
1515
use rustc_middle::query::plumbing::{QuerySystem, QueryVTable};
1616
use rustc_middle::query::{AsLocalQueryKey, QueryCache, QueryMode};

compiler/rustc_query_impl/src/plumbing.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::bug;
1313
#[expect(unused_imports, reason = "used by doc comments")]
1414
use rustc_middle::dep_graph::DepKindVTable;
1515
use rustc_middle::dep_graph::{DepKind, DepNode, DepNodeIndex, DepNodeKey, SerializedDepNodeIndex};
16-
use rustc_middle::queries::QueryKeyId;
16+
use rustc_middle::queries::TaggedQueryKey;
1717
use rustc_middle::query::erase::{Erasable, Erased};
1818
use rustc_middle::query::on_disk_cache::{
1919
AbsoluteBytePos, CacheDecoder, CacheEncoder, EncodedDepNodeIndex,
@@ -90,7 +90,7 @@ pub(crate) fn start_query<R>(
9090
pub(crate) fn create_query_stack_frame<'tcx, C>(
9191
vtable: &'tcx QueryVTable<'tcx, C>,
9292
key: C::Key,
93-
make_id: fn(C::Key) -> QueryKeyId<'tcx>,
93+
make_id: fn(C::Key) -> TaggedQueryKey<'tcx>,
9494
) -> QueryStackFrame<'tcx>
9595
where
9696
C: QueryCache<Key: QueryKey + DynSend + DynSync>,
@@ -486,7 +486,7 @@ macro_rules! define_queries {
486486
let res = crate::execution::gather_active_jobs(
487487
&tcx.query_system.query_vtables.$name,
488488
require_complete,
489-
QueryKeyId::$name,
489+
TaggedQueryKey::$name,
490490
&mut job_map_out,
491491
);
492492
if res.is_none() {

0 commit comments

Comments
 (0)