Skip to content

Commit

Permalink
Remove generic argument from QueryConfig.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Wollersberger committed Oct 12, 2020
1 parent fc3d8e3 commit 39b0e79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/ty/query/plumbing.rs
Expand Up @@ -346,7 +346,7 @@ macro_rules! define_queries_inner {
$(pub type $name<$tcx> = $V;)*
}

$(impl<$tcx> QueryConfig<TyCtxt<$tcx>> for queries::$name<$tcx> {
$(impl<$tcx> QueryConfig for queries::$name<$tcx> {
type Key = $($K)*;
type Value = $V;
type Stored = <
Expand Down Expand Up @@ -447,7 +447,7 @@ macro_rules! define_queries_inner {
#[inline(always)]
#[must_use]
pub fn $name(self, key: query_helper_param_ty!($($K)*))
-> <queries::$name<$tcx> as QueryConfig<TyCtxt<$tcx>>>::Stored
-> <queries::$name<$tcx> as QueryConfig>::Stored
{
self.at(DUMMY_SP).$name(key.into_query_param())
})*
Expand Down Expand Up @@ -486,7 +486,7 @@ macro_rules! define_queries_inner {
$($(#[$attr])*
#[inline(always)]
pub fn $name(self, key: query_helper_param_ty!($($K)*))
-> <queries::$name<$tcx> as QueryConfig<TyCtxt<$tcx>>>::Stored
-> <queries::$name<$tcx> as QueryConfig>::Stored
{
get_query::<queries::$name<'_>, _>(self.tcx, self.span, key.into_query_param())
})*
Expand Down
6 changes: 2 additions & 4 deletions compiler/rustc_query_system/src/query/config.rs
Expand Up @@ -12,9 +12,7 @@ use std::borrow::Cow;
use std::fmt::Debug;
use std::hash::Hash;

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

Expand Down Expand Up @@ -70,7 +68,7 @@ impl<CTX: QueryContext, K, V> QueryVtable<CTX, K, V> {
}
}

pub trait QueryAccessors<CTX: QueryContext>: QueryConfig<CTX> {
pub trait QueryAccessors<CTX: QueryContext>: QueryConfig {
const ANON: bool;
const EVAL_ALWAYS: bool;
const DEP_KIND: CTX::DepKind;
Expand Down

0 comments on commit 39b0e79

Please sign in to comment.