diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index c4ca752762e4..dc8670eacdcf 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -2617,8 +2617,9 @@ macro_rules! assert_unsafe_precondition { #[cfg(bootstrap)] let should_check = cfg!(debug_assertions); + // Turn assertions off in Miri, but otherwise check in codegen #[cfg(not(bootstrap))] - let should_check = ::core::intrinsics::debug_assertions(); + let should_check = !cfg!(miri) && ::core::intrinsics::debug_assertions(); if should_check { // allow non_snake_case to allow capturing const generics