Skip to content

Commit 8c1c90b

Browse files
committed
Make QueryConfig argument a type.
1 parent a17dd36 commit 8c1c90b

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

src/librustc/ty/query/config.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Query configuration and description traits.
2+
13
use crate::dep_graph::SerializedDepNodeIndex;
24
use crate::dep_graph::{DepKind, DepNode};
35
use crate::ty::query::caches::QueryCache;
@@ -13,19 +15,15 @@ use std::borrow::Cow;
1315
use std::fmt::Debug;
1416
use std::hash::Hash;
1517

16-
// Query configuration and description traits.
17-
18-
// FIXME(eddyb) false positive, the lifetime parameter is used for `Key`/`Value`.
19-
#[allow(unused_lifetimes)]
20-
pub trait QueryConfig<'tcx> {
18+
pub trait QueryConfig<CTX> {
2119
const NAME: &'static str;
2220
const CATEGORY: ProfileCategory;
2321

2422
type Key: Eq + Hash + Clone + Debug;
2523
type Value: Clone;
2624
}
2725

28-
pub(crate) trait QueryAccessors<'tcx>: QueryConfig<'tcx> {
26+
pub(crate) trait QueryAccessors<'tcx>: QueryConfig<TyCtxt<'tcx>> {
2927
const ANON: bool;
3028
const EVAL_ALWAYS: bool;
3129
const DEP_KIND: DepKind;

src/librustc/ty/query/plumbing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ macro_rules! define_queries_inner {
956956
})*
957957
}
958958

959-
$(impl<$tcx> QueryConfig<$tcx> for queries::$name<$tcx> {
959+
$(impl<$tcx> QueryConfig<TyCtxt<$tcx>> for queries::$name<$tcx> {
960960
type Key = $K;
961961
type Value = $V;
962962
const NAME: &'static str = stringify!($name);

src/librustc_metadata/rmeta/decoder/cstore_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ macro_rules! provide {
3737
$(fn $name<$lt: $lt, T: IntoArgs>(
3838
$tcx: TyCtxt<$lt>,
3939
def_id_arg: T,
40-
) -> <ty::queries::$name<$lt> as QueryConfig<$lt>>::Value {
40+
) -> <ty::queries::$name<$lt> as QueryConfig<TyCtxt<$lt>>>::Value {
4141
let _prof_timer =
4242
$tcx.prof.generic_activity("metadata_decode_entry");
4343

0 commit comments

Comments
 (0)