We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d37afad commit 67a67d8Copy full SHA for 67a67d8
library/alloc/tests/str.rs
@@ -1978,9 +1978,13 @@ fn const_str_ptr() {
1978
const B: &'static [u8; 2] = &A;
1979
const C: *const u8 = B as *const u8;
1980
1981
- unsafe {
+ #[cfg(not(miri))] // Miri does not deduplicate consts (https://github.com/rust-lang/miri/issues/131)
1982
+ {
1983
let foo = &A as *const u8;
1984
assert_eq!(foo, C);
1985
+ }
1986
+
1987
+ unsafe {
1988
assert_eq!(from_utf8_unchecked(&A), "hi");
1989
assert_eq!(*C, A[0]);
1990
assert_eq!(*(&B[0] as *const u8), A[0]);
0 commit comments