about summary refs log tree commit diff
path: root/tests/ui/consts/std/alloc.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-11-27 14:54:58 +0000
committerbors <bors@rust-lang.org>2023-11-27 14:54:58 +0000
commit9f15a889f0cfa8e407beaa3a44205de971572101 (patch)
treec737c1ccbe9c2db8cd63d335efcd54284741a160 /tests/ui/consts/std/alloc.rs
parentaa330518f47f26c627448832e2cae0a00c57a475 (diff)
parent215d84a8801a585b2ae99af15d2178d13901543c (diff)
downloadrust-9f15a889f0cfa8e407beaa3a44205de971572101.tar.gz
rust-9f15a889f0cfa8e407beaa3a44205de971572101.zip
Auto merge of #118370 - TaKO8Ki:rollup-qfilq2w, r=TaKO8Ki
Rollup of 4 pull requests

Successful merges:

 - #118095 (Enable the Arm Cortex-A53 errata mitigation on aarch64-unknown-none)
 - #118340 (Use helper functions in `pretty.rs` instead of accessing the `Cell`s manually)
 - #118358 (make const tests independent of std debug assertions)
 - #118359 (Suggest swapping the order of `ref` and `box`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/consts/std/alloc.rs')
-rw-r--r--tests/ui/consts/std/alloc.rs19
1 files changed, 0 insertions, 19 deletions
diff --git a/tests/ui/consts/std/alloc.rs b/tests/ui/consts/std/alloc.rs
deleted file mode 100644
index a456a672293..00000000000
--- a/tests/ui/consts/std/alloc.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// stderr-per-bitwidth
-// Strip out raw byte dumps to make comparison platform-independent:
-// normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
-// normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*a(lloc)?[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
-// ignore-debug debug assertions catch some UB too early
-use std::alloc::Layout;
-
-// ok
-const LAYOUT_VALID: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x08) };
-
-// not ok, since alignment needs to be non-zero.
-const LAYOUT_INVALID_ZERO: Layout = unsafe { Layout::from_size_align_unchecked(0x1000, 0x00) };
-//~^ ERROR it is undefined behavior to use this value
-
-// not ok, since alignment needs to be a power of two.
-const LAYOUT_INVALID_THREE: Layout = unsafe { Layout::from_size_align_unchecked(9, 3) };
-//~^ ERROR it is undefined behavior to use this value
-
-fn main() {}