Skip to content

Commit 1525484

Browse files
authored
Rollup merge of rust-lang#124896 - RalfJung:miri-intrinsic-fallback, r=oli-obk
miri: rename intrinsic_fallback_checks_ub to intrinsic_fallback_is_spec Checking UB is not the only concern, we also have to make sure we are not losing out on non-determinism. r? ``@oli-obk`` (not urgent, take your time)
2 parents 074b6e0 + d51ea4b commit 1525484

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/intrinsics.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ pub const unsafe fn assume(b: bool) {
987987
#[unstable(feature = "core_intrinsics", issue = "none")]
988988
#[rustc_intrinsic]
989989
#[rustc_nounwind]
990-
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_checks_ub)]
990+
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
991991
pub const fn likely(b: bool) -> bool {
992992
b
993993
}
@@ -1007,7 +1007,7 @@ pub const fn likely(b: bool) -> bool {
10071007
#[unstable(feature = "core_intrinsics", issue = "none")]
10081008
#[rustc_intrinsic]
10091009
#[rustc_nounwind]
1010-
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_checks_ub)]
1010+
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
10111011
pub const fn unlikely(b: bool) -> bool {
10121012
b
10131013
}
@@ -2483,7 +2483,7 @@ extern "rust-intrinsic" {
24832483
#[rustc_nounwind]
24842484
#[rustc_do_not_const_check]
24852485
#[inline]
2486-
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_checks_ub)]
2486+
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
24872487
pub const fn ptr_guaranteed_cmp<T>(ptr: *const T, other: *const T) -> u8 {
24882488
(ptr == other) as u8
24892489
}
@@ -2748,7 +2748,7 @@ pub const fn ub_checks() -> bool {
27482748
#[unstable(feature = "core_intrinsics", issue = "none")]
27492749
#[rustc_nounwind]
27502750
#[rustc_intrinsic]
2751-
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_checks_ub)]
2751+
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
27522752
pub const unsafe fn const_allocate(_size: usize, _align: usize) -> *mut u8 {
27532753
// const eval overrides this function, but runtime code for now just returns null pointers.
27542754
// See <https://github.com/rust-lang/rust/issues/93935>.
@@ -2769,7 +2769,7 @@ pub const unsafe fn const_allocate(_size: usize, _align: usize) -> *mut u8 {
27692769
#[unstable(feature = "core_intrinsics", issue = "none")]
27702770
#[rustc_nounwind]
27712771
#[rustc_intrinsic]
2772-
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_checks_ub)]
2772+
#[cfg_attr(not(bootstrap), miri::intrinsic_fallback_is_spec)]
27732773
pub const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {
27742774
// Runtime NOP
27752775
}

0 commit comments

Comments
 (0)