mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Respect binding mode of a binding pattern for exhaustiveness check
This commit is contained in:
parent
b17aefb83a
commit
a9ad7be748
4 changed files with 32 additions and 5 deletions
|
@ -883,7 +883,20 @@ static __: () = {
|
|||
match &n { Next(E::Foo | E::Bar) => {} }
|
||||
match &n { _ | Next(E::Bar) => {} }
|
||||
};",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn binding_mode_by_ref() {
|
||||
check_diagnostics_no_bails(
|
||||
r"
|
||||
enum E{ A, B }
|
||||
fn foo() {
|
||||
match &E::A {
|
||||
E::A => {}
|
||||
x => {}
|
||||
}
|
||||
}",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue