Reduce amount of function pointers.
This commit is contained in:
parent
f60a670256
commit
fd318a2f9b
3 changed files with 58 additions and 39 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue