Skip to content

Commit cbbd4d5

Browse files
committed
Regression test for incremental treatment of rustc_scalar_valid_range_{start,end}.
1 parent 7642f10 commit cbbd4d5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// We should not see the unused_attributes lint fire for
2+
// rustc_layout_scalar_valid_range_start, but with this bug we are
3+
// seeing it fire (on subsequent runs) if incremental compilation is
4+
// enabled.
5+
6+
// revisions: rpass1 rpass2
7+
// compile-pass
8+
9+
#![feature(rustc_attrs)]
10+
#![deny(unused_attributes)]
11+
12+
#[rustc_layout_scalar_valid_range_start(10)]
13+
#[rustc_layout_scalar_valid_range_end(30)]
14+
struct RestrictedRange(u32);
15+
const OKAY_RANGE: RestrictedRange = unsafe { RestrictedRange(20) };
16+
17+
fn main() {
18+
OKAY_RANGE.0;
19+
}

0 commit comments

Comments
 (0)