diff options
| author | Ralf Jung <post@ralfj.de> | 2019-12-07 12:47:18 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-12-07 12:47:18 +0100 |
| commit | ab73d10a6ea034892d38fa8203954764c7e9df55 (patch) | |
| tree | 662480cb65e12a1a03a9f01e9db5e0583aa8215c /src/libcore/tests/hash | |
| parent | ca2ffe3a8030e0fb6593cb6905a371441a10a4e0 (diff) | |
| download | rust-ab73d10a6ea034892d38fa8203954764c7e9df55.tar.gz rust-ab73d10a6ea034892d38fa8203954764c7e9df55.zip | |
fix warnings with cfg(miri)
Diffstat (limited to 'src/libcore/tests/hash')
| -rw-r--r-- | src/libcore/tests/hash/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcore/tests/hash/mod.rs b/src/libcore/tests/hash/mod.rs index 1000088e6b0..cdd850d3561 100644 --- a/src/libcore/tests/hash/mod.rs +++ b/src/libcore/tests/hash/mod.rs @@ -70,14 +70,16 @@ fn test_writer_hasher() { let ptr = 5_usize as *mut i32; assert_eq!(hash(&ptr), 5); + if cfg!(miri) { // Miri cannot hash pointers + return; + } + let cs: &mut [u8] = &mut [1, 2, 3]; let ptr = cs.as_ptr(); let slice_ptr = cs as *const [u8]; - #[cfg(not(miri))] // Miri cannot hash pointers assert_eq!(hash(&slice_ptr), hash(&ptr) + cs.len() as u64); let slice_ptr = cs as *mut [u8]; - #[cfg(not(miri))] // Miri cannot hash pointers assert_eq!(hash(&slice_ptr), hash(&ptr) + cs.len() as u64); } |
