about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-05-10 19:09:30 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-05-30 15:15:22 +0200
commitfd318a2f9b3027be74900114a5c6edfc5fb8ec86 (patch)
treec3ed9c7adfaa6ab21d4a0a4b0eddf7065ed10166 /compiler/rustc_query_impl/src
parentf60a67025607e74fbee31c2007f8791c2f352b6a (diff)
downloadrust-fd318a2f9b3027be74900114a5c6edfc5fb8ec86.tar.gz
rust-fd318a2f9b3027be74900114a5c6edfc5fb8ec86.zip
Reduce amount of function pointers.
Diffstat (limited to 'compiler/rustc_query_impl/src')
-rw-r--r--compiler/rustc_query_impl/src/plumbing.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs
index 08309d63a45..de1f89b4468 100644
--- a/compiler/rustc_query_impl/src/plumbing.rs
+++ b/compiler/rustc_query_impl/src/plumbing.rs
@@ -386,14 +386,15 @@ macro_rules! define_queries {
             }
 
             #[inline]
-            fn compute(tcx: QueryCtxt<'tcx>, key: Self::Key) -> Self::Value {
+            fn compute_fn(tcx: QueryCtxt<'tcx>, key: &Self::Key) ->
+                fn(TyCtxt<'tcx>, Self::Key) -> Self::Value
+            {
                 let is_local = key.query_crate() == LOCAL_CRATE;
-                let provider = if is_local {
+                if is_local {
                     tcx.queries.local_providers.$name
                 } else {
                     tcx.queries.extern_providers.$name
-                };
-                provider(*tcx, key)
+                }
             }
 
             fn hash_result(