Inline try_get.

This speeds up lots of rustc-perf benchmark runs. The maximum
improvement is 1%, but there are a lot in the 0.5--1.0% range.
This commit is contained in:
Nicholas Nethercote 2018-05-21 18:35:47 +10:00
parent 4c26e2e3fb
commit 95120164b0

View file

@ -105,6 +105,10 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
/// start executing the query, or it returns with the result of the query.
/// If the query is executing elsewhere, this will wait for it.
/// If the query panicked, this will silently panic.
///
/// This function is inlined because that results in a noticeable speedup
/// for some compile-time benchmarks.
#[inline(always)]
pub(super) fn try_get(
tcx: TyCtxt<'a, 'tcx, '_>,
span: Span,