diff options
| author | Ralf Jung <post@ralfj.de> | 2019-08-04 14:12:11 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-08-04 14:43:02 +0200 |
| commit | 0d1584507ba540becb6fc78dfc2d1f8d1fc60cc1 (patch) | |
| tree | 512838cb0784187018c2b826e1c2dbda675e5abf /src/libcore | |
| parent | 5170a3f45af6a7a2a2e46a115daca8f31379b3a8 (diff) | |
fix UB in a test
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/tests/ptr.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libcore/tests/ptr.rs b/src/libcore/tests/ptr.rs index 569b3197d09..df5f4faa60e 100644 --- a/src/libcore/tests/ptr.rs +++ b/src/libcore/tests/ptr.rs @@ -145,7 +145,6 @@ fn test_as_ref() { } #[test] -#[cfg(not(miri))] // This test is UB according to Stacked Borrows fn test_as_mut() { unsafe { let p: *mut isize = null_mut(); @@ -164,7 +163,7 @@ fn test_as_mut() { // Pointers to unsized types -- slices let s: &mut [u8] = &mut [1, 2, 3]; let ms: *mut [u8] = s; - assert_eq!(ms.as_mut(), Some(s)); + assert_eq!(ms.as_mut().unwrap() as *mut _, s as *mut _); let mz: *mut [u8] = &mut []; assert_eq!(mz.as_mut(), Some(&mut [][..])); |
