mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
merge_match_arms_nested_with_conflicting_identifier
This commit is contained in:
parent
169ec2fdc1
commit
aaec467cfd
1 changed files with 28 additions and 0 deletions
|
@ -648,4 +648,32 @@ fn func(x: MyEnum) {
|
|||
"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn merge_match_arms_nested_with_conflicting_identifier() {
|
||||
check_assist_not_applicable(
|
||||
merge_match_arms,
|
||||
r#"
|
||||
enum Color {
|
||||
Rgb(i32, i32, i32),
|
||||
Hsv(i32, i32, i32),
|
||||
}
|
||||
|
||||
enum Message {
|
||||
Move { x: i32, y: i32 },
|
||||
ChangeColor(u8, Color),
|
||||
}
|
||||
|
||||
fn main(msg: Message) {
|
||||
match msg {
|
||||
Message::ChangeColor(x, Color::Rgb(y, b, c)) => $0"",
|
||||
Message::ChangeColor(y, Color::Hsv(x, b, c)) => "",
|
||||
_ => "other"
|
||||
};
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue