]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/intrinsics.rs
Rollup merge of #66059 - RalfJung:panic-on-non-zero, r=eddyb
[rust.git] / src / libcore / intrinsics.rs
index a889eff75c04438a0b677999fe038d5a6204b3b0..721a2d26a71655744d2b21c38736eea6c3f2f3bd 100644 (file)
     /// This will statically either panic, or do nothing.
     pub fn panic_if_uninhabited<T>();
 
+    /// A guard for unsafe functions that cannot ever be executed if `T` does not permit
+    /// zero-initialization: This will statically either panic, or do nothing.
+    #[cfg(not(bootstrap))]
+    pub fn panic_if_zero_invalid<T>();
+
+    /// A guard for unsafe functions that cannot ever be executed if `T` has invalid
+    /// bit patterns: This will statically either panic, or do nothing.
+    #[cfg(not(bootstrap))]
+    pub fn panic_if_any_invalid<T>();
+
     /// Gets a reference to a static `Location` indicating where it was called.
     #[rustc_const_unstable(feature = "const_caller_location", issue = "47809")]
     pub fn caller_location() -> &'static crate::panic::Location<'static>;