Add a test for #3509

This commit is contained in:
topecongiro 2019-04-14 20:12:58 +09:00
parent 09940a70d0
commit 0d4fb2403c
2 changed files with 33 additions and 0 deletions

View File

@ -217,3 +217,18 @@ fn stmt_expr_attributes() {
#[must_use]
foo = false ;
}
// #3509
fn issue3509() {
match MyEnum {
MyEnum::Option1 if cfg!(target_os = "windows") =>
#[cfg(target_os = "windows")]{
1
}
}
match MyEnum {
MyEnum::Option1 if cfg!(target_os = "windows") =>
#[cfg(target_os = "windows")]
1,
}
}

View File

@ -252,3 +252,21 @@ fn stmt_expr_attributes() {
#[must_use]
foo = false;
}
// #3509
fn issue3509() {
match MyEnum {
MyEnum::Option1 if cfg!(target_os = "windows") =>
#[cfg(target_os = "windows")]
{
1
}
}
match MyEnum {
MyEnum::Option1 if cfg!(target_os = "windows") =>
{
#[cfg(target_os = "windows")]
1
}
}
}