From 0889c9dab388af34e77d5056d504729b4da17d79 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 11 Jul 2022 17:37:56 -0400 Subject: [PATCH] perf check: inline valtree constructors --- compiler/rustc_middle/src/ty/consts/valtree.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_middle/src/ty/consts/valtree.rs b/compiler/rustc_middle/src/ty/consts/valtree.rs index 973dc3dd4a10a..06025331b354e 100644 --- a/compiler/rustc_middle/src/ty/consts/valtree.rs +++ b/compiler/rustc_middle/src/ty/consts/valtree.rs @@ -33,6 +33,7 @@ pub enum ValTree<'tcx> { } impl<'tcx> ValTree<'tcx> { + #[inline(always)] pub fn zst() -> Self { Self::Branch(&[]) } @@ -60,6 +61,7 @@ impl<'tcx> ValTree<'tcx> { Self::Branch(interned) } + #[inline(always)] pub fn from_scalar_int(i: ScalarInt) -> Self { Self::Leaf(i) }