mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
handle match auto-deref
This commit is contained in:
parent
5b4316377b
commit
5fe608fb31
2 changed files with 45 additions and 1 deletions
|
@ -865,6 +865,41 @@ mod tests {
|
|||
check_no_diagnostic(content);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enum_ref_missing_arms() {
|
||||
let content = r"
|
||||
enum Either {
|
||||
A,
|
||||
B,
|
||||
}
|
||||
fn test_fn() {
|
||||
match &Either::B {
|
||||
Either::A => {},
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
check_diagnostic_with_no_fix(content);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enum_ref_no_diagnostic() {
|
||||
let content = r"
|
||||
enum Either {
|
||||
A,
|
||||
B,
|
||||
}
|
||||
fn test_fn() {
|
||||
match &Either::B {
|
||||
Either::A => {},
|
||||
Either::B => {},
|
||||
}
|
||||
}
|
||||
";
|
||||
|
||||
check_no_diagnostic(content);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn enum_containing_bool_no_arms() {
|
||||
let content = r"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue