Skip to content

Commit 5bc50fe

Browse files
authored
Rollup merge of rust-lang#91323 - RalfJung:assert-type, r=oli-obk
CTFE: support assert_zero_valid and assert_uninit_valid This ensures the implementation of all three type-based assert_ intrinsics remains consistent in Miri. `assert_inhabited` recently got stabilized in rust-lang#90896 (meaning stable `const fn` can call it), so do the same with these other intrinsics. Cc ```@rust-lang/wg-const-eval```
2 parents b65d6a5 + bc02c8e commit 5bc50fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/intrinsics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,12 +860,14 @@ extern "rust-intrinsic" {
860860
/// zero-initialization: This will statically either panic, or do nothing.
861861
///
862862
/// This intrinsic does not have a stable counterpart.
863+
#[rustc_const_unstable(feature = "const_assert_type2", issue = "none")]
863864
pub fn assert_zero_valid<T>();
864865

865866
/// A guard for unsafe functions that cannot ever be executed if `T` has invalid
866867
/// bit patterns: This will statically either panic, or do nothing.
867868
///
868869
/// This intrinsic does not have a stable counterpart.
870+
#[rustc_const_unstable(feature = "const_assert_type2", issue = "none")]
869871
pub fn assert_uninit_valid<T>();
870872

871873
/// Gets a reference to a static `Location` indicating where it was called.

0 commit comments

Comments
 (0)