about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-04 11:21:35 +0000
committerbors <bors@rust-lang.org>2020-12-04 11:21:35 +0000
commit2218520b8adf8b8e64b817537d9eb0a84840e2f1 (patch)
tree295e261c239aec41fcb748750152712f98662b06
parente6225434fff7d493baac0aa91c57f2da923ea196 (diff)
parent793c40e0bdf0778dfa979e757e3cbf9f62eeb22c (diff)
downloadrust-2218520b8adf8b8e64b817537d9eb0a84840e2f1.tar.gz
rust-2218520b8adf8b8e64b817537d9eb0a84840e2f1.zip
Auto merge of #79680 - Nadrieril:fix-regression-79284, r=jonas-schievink
Fix perf regression caused by #79284

https://github.com/rust-lang/rust/pull/79284 only moved code around but this changed inlining and caused a large perf regression. This fixes it for me, though I'm less confident than usual because the regression was not observable with my usual (i.e. incremental) compilation settings.

r? `@Mark-Simulacrum`
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
index 3b2eef5a905..8b21a9b24e6 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
@@ -697,6 +697,8 @@ impl<'tcx> Constructor<'tcx> {
     /// Returns whether `self` is covered by `other`, i.e. whether `self` is a subset of `other`.
     /// For the simple cases, this is simply checking for equality. For the "grouped" constructors,
     /// this checks for inclusion.
+    // We inline because this has a single call site in `Matrix::specialize_constructor`.
+    #[inline]
     pub(super) fn is_covered_by<'p>(&self, pcx: PatCtxt<'_, 'p, 'tcx>, other: &Self) -> bool {
         // This must be kept in sync with `is_covered_by_any`.
         match (self, other) {