From 0a2d0b15a1f9b6fe9d6976cba369eb50160ee16d Mon Sep 17 00:00:00 2001 From: Ryo Yoshida Date: Thu, 6 Apr 2023 03:39:59 +0900 Subject: [PATCH] Add regression test for #10989 --- crates/hir-ty/src/tests/regression.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs index 8911dd318c41..35a06fcf61a2 100644 --- a/crates/hir-ty/src/tests/regression.rs +++ b/crates/hir-ty/src/tests/regression.rs @@ -1802,3 +1802,21 @@ where "#, ); } + +#[test] +fn match_ergonomics_with_binding_modes_interaction() { + check_types( + r" +enum E { A } +fn foo() { + match &E::A { + b @ (x @ E::A | x) => { + b; + //^ &E + x; + //^ &E + } + } +}", + ); +}