diff --git a/compiler/rustc_infer/src/infer/type_variable.rs b/compiler/rustc_infer/src/infer/type_variable.rs index 0e832685310..82970f214fa 100644 --- a/compiler/rustc_infer/src/infer/type_variable.rs +++ b/compiler/rustc_infer/src/infer/type_variable.rs @@ -400,6 +400,7 @@ pub(crate) struct TyVidEqKey<'tcx> { } impl<'tcx> From for TyVidEqKey<'tcx> { + #[inline] // make this function eligible for inlining - it is quite hot. fn from(vid: ty::TyVid) -> Self { TyVidEqKey { vid, phantom: PhantomData } } diff --git a/compiler/rustc_type_ir/src/lib.rs b/compiler/rustc_type_ir/src/lib.rs index d9ce169efc1..91dbbec782f 100644 --- a/compiler/rustc_type_ir/src/lib.rs +++ b/compiler/rustc_type_ir/src/lib.rs @@ -437,6 +437,7 @@ impl EqUnifyValue for IntVarValue {} impl UnifyKey for IntVid { type Value = Option; + #[inline] // make this function eligible for inlining - it is quite hot. fn index(&self) -> u32 { self.index }