Skip to content

Commit 67a67d8

Browse files
committed
disable a ptr equality test on Miri
1 parent d37afad commit 67a67d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/alloc/tests/str.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1978,9 +1978,13 @@ fn const_str_ptr() {
19781978
const B: &'static [u8; 2] = &A;
19791979
const C: *const u8 = B as *const u8;
19801980

1981-
unsafe {
1981+
#[cfg(not(miri))] // Miri does not deduplicate consts (https://github.com/rust-lang/miri/issues/131)
1982+
{
19821983
let foo = &A as *const u8;
19831984
assert_eq!(foo, C);
1985+
}
1986+
1987+
unsafe {
19841988
assert_eq!(from_utf8_unchecked(&A), "hi");
19851989
assert_eq!(*C, A[0]);
19861990
assert_eq!(*(&B[0] as *const u8), A[0]);

0 commit comments

Comments
 (0)