about summary refs log tree commit diff
path: root/tests/ui/consts/std/conjure_zst.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-10-04 13:37:12 +0000
committerbors <bors@rust-lang.org>2025-10-04 13:37:12 +0000
commit1bd98acf0e54f1ea678c4fabb8e1b10851eb8465 (patch)
treee1e0adfca6dd8050387b45ffb09c0985cf2a32a8 /tests/ui/consts/std/conjure_zst.rs
parent99b9a8850349e56247acb6ce19910c7f96db8439 (diff)
parent1ebbb3c2fd78de38d0730cf9d874295f0d5dc2f1 (diff)
downloadrust-auto.tar.gz
rust-auto.zip
Auto merge of #147330 - matthiaskrgr:rollup-h4jyzmv, r=matthiaskrgr auto
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#142670 (Document fully-qualified syntax in `as`' keyword doc)
 - rust-lang/rust#145685 (add CloneFromCell and Cell::get_cloned)
 - rust-lang/rust#146330 (Bump unicode_data and printables to version 17.0.0)
 - rust-lang/rust#146451 (Fix atan2 inaccuracy in documentation)
 - rust-lang/rust#146479 (add mem::conjure_zst)
 - rust-lang/rust#147117 (interpret `#[used]` as `#[used(compiler)]` on illumos)
 - rust-lang/rust#147190 (std: `sys::net` cleanups)
 - rust-lang/rust#147251 (Do not assert that a change in global cache only happens when concurrent)
 - rust-lang/rust#147280 (Return to needs-llvm-components being info-only)
 - rust-lang/rust#147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting)
 - rust-lang/rust#147315 (bless autodiff batching test)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/consts/std/conjure_zst.rs')
-rw-r--r--tests/ui/consts/std/conjure_zst.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/consts/std/conjure_zst.rs b/tests/ui/consts/std/conjure_zst.rs
new file mode 100644
index 00000000000..c04deae502b
--- /dev/null
+++ b/tests/ui/consts/std/conjure_zst.rs
@@ -0,0 +1,10 @@
+#![feature(mem_conjure_zst)]
+
+use std::{convert::Infallible, mem};
+
+const INVALID: Infallible = unsafe { mem::conjure_zst() };
+//~^ ERROR attempted to instantiate uninhabited type
+
+const VALID: () = unsafe { mem::conjure_zst() };
+
+fn main() {}