]> git.lizzy.rs Git - rust.git/blob - tests/incremental/issue-59524-layout-scalar-valid-range-is-not-unused.rs
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
[rust.git] / tests / incremental / issue-59524-layout-scalar-valid-range-is-not-unused.rs
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: cfail1 cfail2
7 // build-pass (FIXME(62277): could be check-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 }