We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7f5d78 commit 9b6f8e5Copy full SHA for 9b6f8e5
src/test/ui/layout/valid_range_oob.rs
@@ -0,0 +1,15 @@
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() {}
src/test/ui/layout/valid_range_oob.stderr
@@ -0,0 +1,6 @@
+error: internal compiler error: unexpected panic
+query stack during panic:
+#0 [layout_of] computing layout of `Foo`
+#1 [eval_to_allocation_raw] const-evaluating + checking `FOO`
+end of query stack
0 commit comments