Skip to content

Commit 39b0e79

Browse files
author
Julian Wollersberger
committed
Remove generic argument from QueryConfig.
1 parent fc3d8e3 commit 39b0e79

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

compiler/rustc_middle/src/ty/query/plumbing.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ macro_rules! define_queries_inner {
346346
$(pub type $name<$tcx> = $V;)*
347347
}
348348

349-
$(impl<$tcx> QueryConfig<TyCtxt<$tcx>> for queries::$name<$tcx> {
349+
$(impl<$tcx> QueryConfig for queries::$name<$tcx> {
350350
type Key = $($K)*;
351351
type Value = $V;
352352
type Stored = <
@@ -447,7 +447,7 @@ macro_rules! define_queries_inner {
447447
#[inline(always)]
448448
#[must_use]
449449
pub fn $name(self, key: query_helper_param_ty!($($K)*))
450-
-> <queries::$name<$tcx> as QueryConfig<TyCtxt<$tcx>>>::Stored
450+
-> <queries::$name<$tcx> as QueryConfig>::Stored
451451
{
452452
self.at(DUMMY_SP).$name(key.into_query_param())
453453
})*
@@ -486,7 +486,7 @@ macro_rules! define_queries_inner {
486486
$($(#[$attr])*
487487
#[inline(always)]
488488
pub fn $name(self, key: query_helper_param_ty!($($K)*))
489-
-> <queries::$name<$tcx> as QueryConfig<TyCtxt<$tcx>>>::Stored
489+
-> <queries::$name<$tcx> as QueryConfig>::Stored
490490
{
491491
get_query::<queries::$name<'_>, _>(self.tcx, self.span, key.into_query_param())
492492
})*

compiler/rustc_query_system/src/query/config.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ use std::borrow::Cow;
1212
use std::fmt::Debug;
1313
use std::hash::Hash;
1414

15-
// The parameter `CTX` is required in librustc_middle:
16-
// implementations may need to access the `'tcx` lifetime in `CTX = TyCtxt<'tcx>`.
17-
pub trait QueryConfig<CTX> {
15+
pub trait QueryConfig {
1816
const NAME: &'static str;
1917
const CATEGORY: ProfileCategory;
2018

@@ -70,7 +68,7 @@ impl<CTX: QueryContext, K, V> QueryVtable<CTX, K, V> {
7068
}
7169
}
7270

73-
pub trait QueryAccessors<CTX: QueryContext>: QueryConfig<CTX> {
71+
pub trait QueryAccessors<CTX: QueryContext>: QueryConfig {
7472
const ANON: bool;
7573
const EVAL_ALWAYS: bool;
7674
const DEP_KIND: CTX::DepKind;

0 commit comments

Comments
 (0)