Rollup merge of #100243 - kckeiks:remove-macros-in-query-system, r=cjgillot
Remove opt_remap_env_constness from rustc_query_impl 1st task off #96524. r? `@cjgillot`
This commit is contained in:
commit
e6d47925af
@ -233,21 +233,10 @@ macro_rules! get_provider {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! opt_remap_env_constness {
|
|
||||||
([][$name:ident]) => {};
|
|
||||||
([(remap_env_constness) $($rest:tt)*][$name:ident]) => {
|
|
||||||
let $name = $name.without_const();
|
|
||||||
};
|
|
||||||
([$other:tt $($modifiers:tt)*][$name:ident]) => {
|
|
||||||
opt_remap_env_constness!([$($modifiers)*][$name])
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! define_queries {
|
macro_rules! define_queries {
|
||||||
(<$tcx:tt>
|
(<$tcx:tt>
|
||||||
$($(#[$attr:meta])*
|
$($(#[$attr:meta])*
|
||||||
[$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
|
[$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
|
||||||
|
|
||||||
define_queries_struct! {
|
define_queries_struct! {
|
||||||
tcx: $tcx,
|
tcx: $tcx,
|
||||||
input: ($(([$($modifiers)*] [$($attr)*] [$name]))*)
|
input: ($(([$($modifiers)*] [$($attr)*] [$name]))*)
|
||||||
@ -259,7 +248,6 @@ macro_rules! define_queries {
|
|||||||
// Create an eponymous constructor for each query.
|
// Create an eponymous constructor for each query.
|
||||||
$(#[allow(nonstandard_style)] $(#[$attr])*
|
$(#[allow(nonstandard_style)] $(#[$attr])*
|
||||||
pub fn $name<$tcx>(tcx: QueryCtxt<$tcx>, key: query_keys::$name<$tcx>) -> QueryStackFrame {
|
pub fn $name<$tcx>(tcx: QueryCtxt<$tcx>, key: query_keys::$name<$tcx>) -> QueryStackFrame {
|
||||||
opt_remap_env_constness!([$($modifiers)*][key]);
|
|
||||||
let kind = dep_graph::DepKind::$name;
|
let kind = dep_graph::DepKind::$name;
|
||||||
let name = stringify!($name);
|
let name = stringify!($name);
|
||||||
// Disable visible paths printing for performance reasons.
|
// Disable visible paths printing for performance reasons.
|
||||||
@ -549,7 +537,6 @@ macro_rules! define_queries_struct {
|
|||||||
key: query_keys::$name<$tcx>,
|
key: query_keys::$name<$tcx>,
|
||||||
mode: QueryMode,
|
mode: QueryMode,
|
||||||
) -> Option<query_stored::$name<$tcx>> {
|
) -> Option<query_stored::$name<$tcx>> {
|
||||||
opt_remap_env_constness!([$($modifiers)*][key]);
|
|
||||||
let qcx = QueryCtxt { tcx, queries: self };
|
let qcx = QueryCtxt { tcx, queries: self };
|
||||||
get_query::<queries::$name<$tcx>, _>(qcx, span, key, mode)
|
get_query::<queries::$name<$tcx>, _>(qcx, span, key, mode)
|
||||||
})*
|
})*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user