Skip to content

Commit bc76e8b

Browse files
authored
Rollup merge of rust-lang#50931 - nnethercote:inline-try_get, r=michaelwoerister
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.
2 parents 696b84c + 9512016 commit bc76e8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/ty/maps/plumbing.rs

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

0 commit comments

Comments
 (0)