Remove generic argument from QueryConfig
.
This commit is contained in:
parent
fc3d8e3fcc
commit
39b0e79285
@ -346,7 +346,7 @@ macro_rules! define_queries_inner {
|
|||||||
$(pub type $name<$tcx> = $V;)*
|
$(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 Key = $($K)*;
|
||||||
type Value = $V;
|
type Value = $V;
|
||||||
type Stored = <
|
type Stored = <
|
||||||
@ -447,7 +447,7 @@ macro_rules! define_queries_inner {
|
|||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn $name(self, key: query_helper_param_ty!($($K)*))
|
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())
|
self.at(DUMMY_SP).$name(key.into_query_param())
|
||||||
})*
|
})*
|
||||||
@ -486,7 +486,7 @@ macro_rules! define_queries_inner {
|
|||||||
$($(#[$attr])*
|
$($(#[$attr])*
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn $name(self, key: query_helper_param_ty!($($K)*))
|
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())
|
get_query::<queries::$name<'_>, _>(self.tcx, self.span, key.into_query_param())
|
||||||
})*
|
})*
|
||||||
|
@ -12,9 +12,7 @@ use std::borrow::Cow;
|
|||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
|
|
||||||
// The parameter `CTX` is required in librustc_middle:
|
pub trait QueryConfig {
|
||||||
// implementations may need to access the `'tcx` lifetime in `CTX = TyCtxt<'tcx>`.
|
|
||||||
pub trait QueryConfig<CTX> {
|
|
||||||
const NAME: &'static str;
|
const NAME: &'static str;
|
||||||
const CATEGORY: ProfileCategory;
|
const CATEGORY: ProfileCategory;
|
||||||
|
|
||||||
@ -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 ANON: bool;
|
||||||
const EVAL_ALWAYS: bool;
|
const EVAL_ALWAYS: bool;
|
||||||
const DEP_KIND: CTX::DepKind;
|
const DEP_KIND: CTX::DepKind;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user