X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcore%2Fintrinsics.rs;h=721a2d26a71655744d2b21c38736eea6c3f2f3bd;hb=a7c2eef2aeb23f52efc4a4bfd240292d43a61798;hp=a889eff75c04438a0b677999fe038d5a6204b3b0;hpb=e453a0cc49ad83fbb54fb22f9bba7545f5a92c68;p=rust.git diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index a889eff75c0..721a2d26a71 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -1007,6 +1007,16 @@ /// This will statically either panic, or do nothing. pub fn panic_if_uninhabited(); + /// 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(); + + /// 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(); + /// 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>;