diff options
| author | Michael Goulet <michael@errs.io> | 2023-03-13 18:54:05 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-03-21 15:38:51 +0000 |
| commit | 2eb1c08e433aadf2362a65f2ef1387670a6d34cf (patch) | |
| tree | 1d8465f4d80adbbe4a44dd72eedc3361bd2b8f7c /compiler/rustc_query_impl/src | |
| parent | a01b4cc9f375f1b95fa8195daeea938d3d9c4c34 (diff) | |
| download | rust-2eb1c08e433aadf2362a65f2ef1387670a6d34cf.tar.gz rust-2eb1c08e433aadf2362a65f2ef1387670a6d34cf.zip | |
Use local key in providers
Diffstat (limited to 'compiler/rustc_query_impl/src')
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index ca3c3997df0..9bba26cc8e8 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -274,19 +274,19 @@ macro_rules! hash_result { }; } -macro_rules! get_provider { - ([][$tcx:expr, $name:ident, $key:expr]) => {{ - $tcx.queries.local_providers.$name +macro_rules! call_provider { + ([][$qcx:expr, $name:ident, $key:expr]) => {{ + ($qcx.queries.local_providers.$name)($qcx.tcx, $key) }}; - ([(separate_provide_extern) $($rest:tt)*][$tcx:expr, $name:ident, $key:expr]) => {{ - if $key.query_crate_is_local() { - $tcx.queries.local_providers.$name + ([(separate_provide_extern) $($rest:tt)*][$qcx:expr, $name:ident, $key:expr]) => {{ + if let Some(key) = $key.as_local_key() { + ($qcx.queries.local_providers.$name)($qcx.tcx, key) } else { - $tcx.queries.extern_providers.$name + ($qcx.queries.extern_providers.$name)($qcx.tcx, $key) } }}; ([$other:tt $($modifiers:tt)*][$($args:tt)*]) => { - get_provider!([$($modifiers)*][$($args)*]) + call_provider!([$($modifiers)*][$($args)*]) }; } @@ -516,7 +516,7 @@ macro_rules! define_queries { fn compute(self, qcx: QueryCtxt<'tcx>, key: Self::Key) -> Self::Value { query_provided_to_value::$name( qcx.tcx, - get_provider!([$($modifiers)*][qcx, $name, key])(qcx.tcx, key) + call_provider!([$($modifiers)*][qcx, $name, key]) ) } |
