From e0fd8ddbc03b9ea8b9b3b9b04068ae60e8407b2c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 2 May 2024 17:39:49 +1000 Subject: [PATCH] Inline `{args,consts}_may_unify`. This speeds up compilation of `bitmaps-3.1.0` and `typenum-1.17.0`. --- compiler/rustc_middle/src/ty/fast_reject.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_middle/src/ty/fast_reject.rs b/compiler/rustc_middle/src/ty/fast_reject.rs index a4fb51303c580..86158fec021f9 100644 --- a/compiler/rustc_middle/src/ty/fast_reject.rs +++ b/compiler/rustc_middle/src/ty/fast_reject.rs @@ -167,6 +167,7 @@ pub struct DeepRejectCtxt { } impl DeepRejectCtxt { + #[inline] pub fn args_may_unify<'tcx>( self, obligation_args: GenericArgsRef<'tcx>, @@ -329,6 +330,7 @@ impl DeepRejectCtxt { } } + #[inline(always)] pub fn consts_may_unify(self, obligation_ct: ty::Const<'_>, impl_ct: ty::Const<'_>) -> bool { let k = impl_ct.kind(); let impl_val = match k {