merge_match_arms_nested_with_conflicting_identifier

This commit is contained in:
Jeroen Vannevel 2022-01-11 20:17:47 +00:00
parent 169ec2fdc1
commit aaec467cfd
No known key found for this signature in database
GPG Key ID: 78EF5F52F38C49BD

View File

@ -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"
};
}
"#,
)
}
}