Skip to content

Commit 0a2d0b1

Browse files
committed
Add regression test for rust-lang#10989
1 parent e8bad53 commit 0a2d0b1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

crates/hir-ty/src/tests/regression.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1802,3 +1802,21 @@ where
18021802
"#,
18031803
);
18041804
}
1805+
1806+
#[test]
1807+
fn match_ergonomics_with_binding_modes_interaction() {
1808+
check_types(
1809+
r"
1810+
enum E { A }
1811+
fn foo() {
1812+
match &E::A {
1813+
b @ (x @ E::A | x) => {
1814+
b;
1815+
//^ &E
1816+
x;
1817+
//^ &E
1818+
}
1819+
}
1820+
}",
1821+
);
1822+
}

0 commit comments

Comments
 (0)