From f14b5d9ee6327967fdb69d32fc3c1b7c989acda7 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 7 Jun 2018 09:33:24 +1000 Subject: [PATCH] Inline `process_obligation`. It's very hot, and this speeds things up. --- src/librustc/traits/fulfill.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc/traits/fulfill.rs b/src/librustc/traits/fulfill.rs index af24f3166d72..68ad1e665adc 100644 --- a/src/librustc/traits/fulfill.rs +++ b/src/librustc/traits/fulfill.rs @@ -266,6 +266,10 @@ impl<'a, 'b, 'gcx, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'b, 'gcx, /// - `Ok(Some(v))` if the predicate is true, presuming that `v` are also true /// - `Ok(None)` if we don't have enough info to be sure /// - `Err` if the predicate does not hold + /// + /// This is always inlined, despite its size, because it has a single + /// callsite and it is called *very* frequently. + #[inline(always)] fn process_obligation(&mut self, pending_obligation: &mut Self::Obligation) -> Result>, Self::Error>