Skip to content

Commit d81f5ab

Browse files
committed
Inline some functions that suddenly show up more in traces
1 parent 74af01b commit d81f5ab

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

compiler/rustc_middle/src/ty/instance.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ impl<'tcx> Instance<'tcx> {
483483
if let Some(substs) = self.substs_for_mir_body() { v.subst(tcx, substs) } else { *v }
484484
}
485485

486+
#[inline(always)]
486487
pub fn subst_mir_and_normalize_erasing_regions<T>(
487488
&self,
488489
tcx: TyCtxt<'tcx>,

compiler/rustc_middle/src/ty/normalize_erasing_regions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ impl TypeFolder<'tcx> for NormalizeAfterErasingRegionsFolder<'tcx> {
103103
self.tcx.normalize_generic_arg_after_erasing_regions(arg).expect_const()
104104
}
105105

106+
#[inline]
106107
fn fold_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> mir::ConstantKind<'tcx> {
107108
let arg = self.param_env.and(c);
108109
self.tcx.normalize_mir_const_after_erasing_regions(arg)

compiler/rustc_middle/src/ty/subst.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,8 @@ impl<'a, 'tcx> TypeFolder<'tcx> for SubstFolder<'a, 'tcx> {
505505
}
506506
}
507507

508+
#[inline]
508509
fn fold_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> mir::ConstantKind<'tcx> {
509-
if !c.needs_subst() {
510-
return c;
511-
}
512510
c.super_fold_with(self)
513511
}
514512
}

0 commit comments

Comments
 (0)