]> git.lizzy.rs Git - rust.git/blob - tests/ui/layout/valid_range_oob.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / layout / valid_range_oob.rs
1 // failure-status: 101
2 // normalize-stderr-test "note: .*\n\n" -> ""
3 // normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
4 // rustc-env:RUST_BACKTRACE=0
5
6 #![feature(rustc_attrs)]
7
8 #[rustc_layout_scalar_valid_range_end(257)]
9 struct Foo(i8);
10
11 // Need to do in a constant, as runtime codegen
12 // does not compute the layout of `Foo` in check builds.
13 const FOO: Foo = unsafe { Foo(1) };
14
15 fn main() {}