Skip to content

Commit fac9722

Browse files
committed
Inline some functions that show up in perf runs
1 parent 0f7d817 commit fac9722

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/rustc_middle/src/ty/context.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2817,6 +2817,7 @@ impl<'tcx> TyCtxt<'tcx> {
28172817
self.mk_substs(iter::once(self_ty.into()).chain(rest))
28182818
}
28192819

2820+
#[inline(always)]
28202821
pub fn mk_trait_ref(
28212822
self,
28222823
trait_def_id: DefId,

compiler/rustc_middle/src/ty/sty.rs

+2
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,12 @@ pub struct TraitRef<'tcx> {
807807
}
808808

809809
impl<'tcx> TraitRef<'tcx> {
810+
#[inline(always)]
810811
pub fn new(def_id: DefId, substs: SubstsRef<'tcx>) -> TraitRef<'tcx> {
811812
TraitRef { def_id, substs }
812813
}
813814

815+
#[inline(always)]
814816
pub fn with_self_type(self, tcx: TyCtxt<'tcx>, self_ty: Ty<'tcx>) -> Self {
815817
tcx.mk_trait_ref(
816818
self.def_id,

0 commit comments

Comments
 (0)