about summary refs log tree commit diff
path: root/library/alloc/tests
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-12-02 13:49:33 +0100
committerRalf Jung <post@ralfj.de>2020-12-02 13:49:33 +0100
commit67a67d827abfe506977938efaeb5c38b3ea94bf6 (patch)
treeb7800eb08ce34b77b6ea1b785cfc2cfb0a62eb29 /library/alloc/tests
parentd37afad0cc87bf709ad10c85319296ac53030f03 (diff)
downloadrust-67a67d827abfe506977938efaeb5c38b3ea94bf6.tar.gz
rust-67a67d827abfe506977938efaeb5c38b3ea94bf6.zip
disable a ptr equality test on Miri
Diffstat (limited to 'library/alloc/tests')
-rw-r--r--library/alloc/tests/str.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/library/alloc/tests/str.rs b/library/alloc/tests/str.rs
index b1301914656..04077f88414 100644
--- a/library/alloc/tests/str.rs
+++ b/library/alloc/tests/str.rs
@@ -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]);