From 72f144de242499776d8ca2f6626d63d169781a05 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 12 May 2022 11:29:01 +0000 Subject: [PATCH] Give the inliner some hints --- compiler/rustc_middle/src/traits/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs index 4b67fc84d2e..8072dd16ae8 100644 --- a/compiler/rustc_middle/src/traits/mod.rs +++ b/compiler/rustc_middle/src/traits/mod.rs @@ -133,6 +133,7 @@ impl<'tcx> ObligationCause<'tcx> { ObligationCause::dummy_with_span(DUMMY_SP) } + #[inline(always)] pub fn dummy_with_span(span: Span) -> ObligationCause<'tcx> { ObligationCause { span, body_id: hir::CRATE_HIR_ID, code: Default::default() } } @@ -203,6 +204,7 @@ pub struct InternedObligationCauseCode<'tcx> { } impl<'tcx> From> for InternedObligationCauseCode<'tcx> { + #[inline(always)] fn from(code: ObligationCauseCode<'tcx>) -> Self { Self { code: if code == MISC_OBLIGATION_CAUSE_CODE { None } else { Some(Lrc::new(code)) } } }