Skip to content

Commit 37959a9

Browse files
committed
Add a test for #3498
1 parent 09940a7 commit 37959a9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

tests/source/expr.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,3 +532,16 @@ fn issue3457() {
532532
}
533533
}
534534
}
535+
536+
// #3498
537+
static REPRO: &[usize] = &[#[cfg(feature = "zero")]
538+
0];
539+
540+
fn overflow_with_attr() {
541+
foo(#[cfg(feature = "zero")]
542+
0);
543+
foobar(#[cfg(feature = "zero")]
544+
0);
545+
foobar(x, y, #[cfg(feature = "zero")]
546+
{});
547+
}

tests/target/expr.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,3 +615,26 @@ fn issue3457() {
615615
}
616616
}
617617
}
618+
619+
// #3498
620+
static REPRO: &[usize] = &[
621+
#[cfg(feature = "zero")]
622+
0,
623+
];
624+
625+
fn overflow_with_attr() {
626+
foo(
627+
#[cfg(feature = "zero")]
628+
0,
629+
);
630+
foobar(
631+
#[cfg(feature = "zero")]
632+
0,
633+
);
634+
foobar(
635+
x,
636+
y,
637+
#[cfg(feature = "zero")]
638+
{},
639+
);
640+
}

0 commit comments

Comments
 (0)