Skip to content

Commit 0d4fb24

Browse files
committed
Add a test for rust-lang#3509
1 parent 09940a7 commit 0d4fb24

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/source/attrib.rs

+15
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,18 @@ fn stmt_expr_attributes() {
217217
#[must_use]
218218
foo = false ;
219219
}
220+
221+
// #3509
222+
fn issue3509() {
223+
match MyEnum {
224+
MyEnum::Option1 if cfg!(target_os = "windows") =>
225+
#[cfg(target_os = "windows")]{
226+
1
227+
}
228+
}
229+
match MyEnum {
230+
MyEnum::Option1 if cfg!(target_os = "windows") =>
231+
#[cfg(target_os = "windows")]
232+
1,
233+
}
234+
}

tests/target/attrib.rs

+18
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,21 @@ fn stmt_expr_attributes() {
252252
#[must_use]
253253
foo = false;
254254
}
255+
256+
// #3509
257+
fn issue3509() {
258+
match MyEnum {
259+
MyEnum::Option1 if cfg!(target_os = "windows") =>
260+
#[cfg(target_os = "windows")]
261+
{
262+
1
263+
}
264+
}
265+
match MyEnum {
266+
MyEnum::Option1 if cfg!(target_os = "windows") =>
267+
{
268+
#[cfg(target_os = "windows")]
269+
1
270+
}
271+
}
272+
}

0 commit comments

Comments
 (0)