Skip to content

Commit

Permalink
Inline some functions that suddenly show up more in traces
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Apr 1, 2021
1 parent 74af01b commit d81f5ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/ty/instance.rs
Expand Up @@ -483,6 +483,7 @@ impl<'tcx> Instance<'tcx> {
if let Some(substs) = self.substs_for_mir_body() { v.subst(tcx, substs) } else { *v }
}

#[inline(always)]
pub fn subst_mir_and_normalize_erasing_regions<T>(
&self,
tcx: TyCtxt<'tcx>,
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_middle/src/ty/normalize_erasing_regions.rs
Expand Up @@ -103,6 +103,7 @@ impl TypeFolder<'tcx> for NormalizeAfterErasingRegionsFolder<'tcx> {
self.tcx.normalize_generic_arg_after_erasing_regions(arg).expect_const()
}

#[inline]
fn fold_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> mir::ConstantKind<'tcx> {
let arg = self.param_env.and(c);
self.tcx.normalize_mir_const_after_erasing_regions(arg)
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_middle/src/ty/subst.rs
Expand Up @@ -505,10 +505,8 @@ impl<'a, 'tcx> TypeFolder<'tcx> for SubstFolder<'a, 'tcx> {
}
}

#[inline]
fn fold_mir_const(&mut self, c: mir::ConstantKind<'tcx>) -> mir::ConstantKind<'tcx> {
if !c.needs_subst() {
return c;
}
c.super_fold_with(self)
}
}
Expand Down

0 comments on commit d81f5ab

Please sign in to comment.