disable a ptr equality test on Miri
This commit is contained in:
parent
d37afad0cc
commit
67a67d827a
1 changed files with 5 additions and 1 deletions
|
@ -1978,9 +1978,13 @@ fn const_str_ptr() {
|
|||
const B: &'static [u8; 2] = &A;
|
||||
const C: *const u8 = B as *const u8;
|
||||
|
||||
unsafe {
|
||||
#[cfg(not(miri))] // Miri does not deduplicate consts (https://github.com/rust-lang/miri/issues/131)
|
||||
{
|
||||
let foo = &A as *const u8;
|
||||
assert_eq!(foo, C);
|
||||
}
|
||||
|
||||
unsafe {
|
||||
assert_eq!(from_utf8_unchecked(&A), "hi");
|
||||
assert_eq!(*C, A[0]);
|
||||
assert_eq!(*(&B[0] as *const u8), A[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue