diff options
| -rw-r--r-- | src/libcore/tests/cell.rs | 5 | ||||
| -rw-r--r-- | src/libcore/tests/iter.rs | 8 | ||||
| -rw-r--r-- | src/libcore/tests/slice.rs | 8 | ||||
| -rw-r--r-- | src/libcore/tests/time.rs | 5 |
4 files changed, 11 insertions, 15 deletions
diff --git a/src/libcore/tests/cell.rs b/src/libcore/tests/cell.rs index 73bdaab5861..b16416022c0 100644 --- a/src/libcore/tests/cell.rs +++ b/src/libcore/tests/cell.rs @@ -1,5 +1,3 @@ -#![cfg(not(miri))] - use core::cell::*; use core::default::Default; use std::mem::drop; @@ -111,6 +109,7 @@ fn double_borrow_single_release_no_borrow_mut() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn discard_doesnt_unborrow() { let x = RefCell::new(0); let _b = x.borrow(); @@ -351,6 +350,7 @@ fn refcell_ref_coercion() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn refcell_swap_borrows() { let x = RefCell::new(0); let _b = x.borrow(); @@ -360,6 +360,7 @@ fn refcell_swap_borrows() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn refcell_replace_borrows() { let x = RefCell::new(0); let _b = x.borrow(); diff --git a/src/libcore/tests/iter.rs b/src/libcore/tests/iter.rs index 04c5bf7e95b..bc951829bd7 100644 --- a/src/libcore/tests/iter.rs +++ b/src/libcore/tests/iter.rs @@ -190,7 +190,6 @@ fn test_iterator_step_by() { } #[test] -#[cfg(not(miri))] fn test_iterator_step_by_nth() { let mut it = (0..16).step_by(5); assert_eq!(it.nth(0), Some(0)); @@ -209,7 +208,6 @@ fn test_iterator_step_by_nth() { } #[test] -#[cfg(not(miri))] fn test_iterator_step_by_nth_overflow() { #[cfg(target_pointer_width = "8")] type Bigger = u16; @@ -262,7 +260,6 @@ fn test_iterator_step_by_zero() { } #[test] -#[cfg(not(miri))] fn test_iterator_step_by_size_hint() { struct StubSizeHint(usize, Option<usize>); impl Iterator for StubSizeHint { @@ -1657,7 +1654,6 @@ fn test_range_inclusive_nth() { } #[test] -#[cfg(not(miri))] fn test_range_step() { #![allow(deprecated)] @@ -1665,7 +1661,9 @@ fn test_range_step() { assert_eq!((1..21).rev().step_by(5).collect::<Vec<isize>>(), [20, 15, 10, 5]); assert_eq!((1..21).rev().step_by(6).collect::<Vec<isize>>(), [20, 14, 8, 2]); assert_eq!((200..255).step_by(50).collect::<Vec<u8>>(), [200, 250]); + #[cfg(not(miri))] // Miri cannot compare empty slices assert_eq!((200..-5).step_by(1).collect::<Vec<isize>>(), []); + #[cfg(not(miri))] // Miri cannot compare empty slices assert_eq!((200..200).step_by(1).collect::<Vec<isize>>(), []); assert_eq!((0..20).step_by(1).size_hint(), (20, Some(20))); @@ -1681,7 +1679,6 @@ fn test_range_step() { } #[test] -#[cfg(not(miri))] fn test_step_by_skip() { assert_eq!((0..640).step_by(128).skip(1).collect::<Vec<_>>(), [128, 256, 384, 512]); assert_eq!((0..=50).step_by(10).nth(3), Some(30)); @@ -1689,7 +1686,6 @@ fn test_step_by_skip() { } #[test] -#[cfg(not(miri))] fn test_range_inclusive_step() { assert_eq!((0..=50).step_by(10).collect::<Vec<_>>(), [0, 10, 20, 30, 40, 50]); assert_eq!((0..=5).step_by(1).collect::<Vec<_>>(), [0, 1, 2, 3, 4, 5]); diff --git a/src/libcore/tests/slice.rs b/src/libcore/tests/slice.rs index 454c1235c81..31d16e0e320 100644 --- a/src/libcore/tests/slice.rs +++ b/src/libcore/tests/slice.rs @@ -1015,7 +1015,7 @@ fn test_rotate_right() { #[test] #[cfg(not(target_arch = "wasm32"))] -#[cfg(not(miri))] +#[cfg(not(miri))] // Miri does not support entropy fn sort_unstable() { use core::cmp::Ordering::{Equal, Greater, Less}; use core::slice::heapsort; @@ -1171,7 +1171,7 @@ pub mod memchr { } #[test] -#[cfg(not(miri))] +#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation fn test_align_to_simple() { let bytes = [1u8, 2, 3, 4, 5, 6, 7]; let (prefix, aligned, suffix) = unsafe { bytes.align_to::<u16>() }; @@ -1187,7 +1187,6 @@ fn test_align_to_simple() { } #[test] -#[cfg(not(miri))] fn test_align_to_zst() { let bytes = [1, 2, 3, 4, 5, 6, 7]; let (prefix, aligned, suffix) = unsafe { bytes.align_to::<()>() }; @@ -1196,7 +1195,7 @@ fn test_align_to_zst() { } #[test] -#[cfg(not(miri))] +#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation fn test_align_to_non_trivial() { #[repr(align(8))] struct U64(u64, u64); #[repr(align(8))] struct U64U64U32(u64, u64, u32); @@ -1208,7 +1207,6 @@ fn test_align_to_non_trivial() { } #[test] -#[cfg(not(miri))] fn test_align_to_empty_mid() { use core::mem; diff --git a/src/libcore/tests/time.rs b/src/libcore/tests/time.rs index d39bd06930a..f7d00304df5 100644 --- a/src/libcore/tests/time.rs +++ b/src/libcore/tests/time.rs @@ -1,5 +1,3 @@ -#![cfg(not(miri))] - use core::time::Duration; #[test] @@ -109,12 +107,14 @@ fn checked_sub() { #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn sub_bad1() { let _ = Duration::new(0, 0) - Duration::new(0, 1); } #[test] #[should_panic] +#[cfg(not(miri))] // Miri does not support panics fn sub_bad2() { let _ = Duration::new(0, 0) - Duration::new(1, 0); } @@ -287,6 +287,7 @@ fn debug_formatting_precision_two() { } #[test] +#[cfg(not(miri))] // FIXME: A bug in Miri breaks padding in string formatting fn debug_formatting_precision_high() { assert_eq!(format!("{:.5?}", Duration::new(0, 23_678)), "23.67800µs"); |
