1- #![ cfg( not( miri) ) ]
2-
31use std:: cell:: Cell ;
42use std:: cmp:: Ordering :: { self , Equal , Greater , Less } ;
53use std:: mem;
@@ -260,6 +258,7 @@ fn test_swap_remove() {
260258
261259#[ test]
262260#[ should_panic]
261+ #[ cfg( not( miri) ) ] // Miri does not support panics
263262fn test_swap_remove_fail ( ) {
264263 let mut v = vec ! [ 1 ] ;
265264 let _ = v. swap_remove ( 0 ) ;
@@ -391,6 +390,7 @@ fn test_reverse() {
391390}
392391
393392#[ test]
393+ #[ cfg( not( miri) ) ] // Miri does not support entropy
394394fn test_sort ( ) {
395395 let mut rng = thread_rng ( ) ;
396396
@@ -467,6 +467,7 @@ fn test_sort() {
467467}
468468
469469#[ test]
470+ #[ cfg( not( miri) ) ] // Miri does not support entropy
470471fn test_sort_stability ( ) {
471472 for len in ( 2 ..25 ) . chain ( 500 ..510 ) {
472473 for _ in 0 ..10 {
@@ -631,6 +632,7 @@ fn test_insert() {
631632
632633#[ test]
633634#[ should_panic]
635+ #[ cfg( not( miri) ) ] // Miri does not support panics
634636fn test_insert_oob ( ) {
635637 let mut a = vec ! [ 1 , 2 , 3 ] ;
636638 a. insert ( 4 , 5 ) ;
@@ -655,6 +657,7 @@ fn test_remove() {
655657
656658#[ test]
657659#[ should_panic]
660+ #[ cfg( not( miri) ) ] // Miri does not support panics
658661fn test_remove_fail ( ) {
659662 let mut a = vec ! [ 1 ] ;
660663 let _ = a. remove ( 0 ) ;
@@ -936,6 +939,7 @@ fn test_windowsator() {
936939
937940#[ test]
938941#[ should_panic]
942+ #[ cfg( not( miri) ) ] // Miri does not support panics
939943fn test_windowsator_0 ( ) {
940944 let v = & [ 1 , 2 , 3 , 4 ] ;
941945 let _it = v. windows ( 0 ) ;
@@ -960,6 +964,7 @@ fn test_chunksator() {
960964
961965#[ test]
962966#[ should_panic]
967+ #[ cfg( not( miri) ) ] // Miri does not support panics
963968fn test_chunksator_0 ( ) {
964969 let v = & [ 1 , 2 , 3 , 4 ] ;
965970 let _it = v. chunks ( 0 ) ;
@@ -984,6 +989,7 @@ fn test_chunks_exactator() {
984989
985990#[ test]
986991#[ should_panic]
992+ #[ cfg( not( miri) ) ] // Miri does not support panics
987993fn test_chunks_exactator_0 ( ) {
988994 let v = & [ 1 , 2 , 3 , 4 ] ;
989995 let _it = v. chunks_exact ( 0 ) ;
@@ -1008,6 +1014,7 @@ fn test_rchunksator() {
10081014
10091015#[ test]
10101016#[ should_panic]
1017+ #[ cfg( not( miri) ) ] // Miri does not support panics
10111018fn test_rchunksator_0 ( ) {
10121019 let v = & [ 1 , 2 , 3 , 4 ] ;
10131020 let _it = v. rchunks ( 0 ) ;
@@ -1032,6 +1039,7 @@ fn test_rchunks_exactator() {
10321039
10331040#[ test]
10341041#[ should_panic]
1042+ #[ cfg( not( miri) ) ] // Miri does not support panics
10351043fn test_rchunks_exactator_0 ( ) {
10361044 let v = & [ 1 , 2 , 3 , 4 ] ;
10371045 let _it = v. rchunks_exact ( 0 ) ;
@@ -1084,6 +1092,7 @@ fn test_vec_default() {
10841092
10851093#[ test]
10861094#[ should_panic]
1095+ #[ cfg( not( miri) ) ] // Miri does not support panics
10871096fn test_overflow_does_not_cause_segfault ( ) {
10881097 let mut v = vec ! [ ] ;
10891098 v. reserve_exact ( !0 ) ;
@@ -1093,6 +1102,7 @@ fn test_overflow_does_not_cause_segfault() {
10931102
10941103#[ test]
10951104#[ should_panic]
1105+ #[ cfg( not( miri) ) ] // Miri does not support panics
10961106fn test_overflow_does_not_cause_segfault_managed ( ) {
10971107 let mut v = vec ! [ Rc :: new( 1 ) ] ;
10981108 v. reserve_exact ( !0 ) ;
@@ -1268,6 +1278,7 @@ fn test_mut_chunks_rev() {
12681278
12691279#[ test]
12701280#[ should_panic]
1281+ #[ cfg( not( miri) ) ] // Miri does not support panics
12711282fn test_mut_chunks_0 ( ) {
12721283 let mut v = [ 1 , 2 , 3 , 4 ] ;
12731284 let _it = v. chunks_mut ( 0 ) ;
@@ -1300,6 +1311,7 @@ fn test_mut_chunks_exact_rev() {
13001311
13011312#[ test]
13021313#[ should_panic]
1314+ #[ cfg( not( miri) ) ] // Miri does not support panics
13031315fn test_mut_chunks_exact_0 ( ) {
13041316 let mut v = [ 1 , 2 , 3 , 4 ] ;
13051317 let _it = v. chunks_exact_mut ( 0 ) ;
@@ -1332,6 +1344,7 @@ fn test_mut_rchunks_rev() {
13321344
13331345#[ test]
13341346#[ should_panic]
1347+ #[ cfg( not( miri) ) ] // Miri does not support panics
13351348fn test_mut_rchunks_0 ( ) {
13361349 let mut v = [ 1 , 2 , 3 , 4 ] ;
13371350 let _it = v. rchunks_mut ( 0 ) ;
@@ -1364,6 +1377,7 @@ fn test_mut_rchunks_exact_rev() {
13641377
13651378#[ test]
13661379#[ should_panic]
1380+ #[ cfg( not( miri) ) ] // Miri does not support panics
13671381fn test_mut_rchunks_exact_0 ( ) {
13681382 let mut v = [ 1 , 2 , 3 , 4 ] ;
13691383 let _it = v. rchunks_exact_mut ( 0 ) ;
@@ -1397,6 +1411,7 @@ fn test_box_slice_clone() {
13971411#[ test]
13981412#[ allow( unused_must_use) ] // here, we care about the side effects of `.clone()`
13991413#[ cfg_attr( target_os = "emscripten" , ignore) ]
1414+ #[ cfg( not( miri) ) ] // Miri does not support panics
14001415fn test_box_slice_clone_panics ( ) {
14011416 use std:: sync:: Arc ;
14021417 use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
@@ -1461,6 +1476,7 @@ fn test_copy_from_slice() {
14611476
14621477#[ test]
14631478#[ should_panic( expected = "destination and source slices have different lengths" ) ]
1479+ #[ cfg( not( miri) ) ] // Miri does not support panics
14641480fn test_copy_from_slice_dst_longer ( ) {
14651481 let src = [ 0 , 1 , 2 , 3 ] ;
14661482 let mut dst = [ 0 ; 5 ] ;
@@ -1469,6 +1485,7 @@ fn test_copy_from_slice_dst_longer() {
14691485
14701486#[ test]
14711487#[ should_panic( expected = "destination and source slices have different lengths" ) ]
1488+ #[ cfg( not( miri) ) ] // Miri does not support panics
14721489fn test_copy_from_slice_dst_shorter ( ) {
14731490 let src = [ 0 , 1 , 2 , 3 ] ;
14741491 let mut dst = [ 0 ; 3 ] ;
@@ -1588,6 +1605,7 @@ thread_local!(static SILENCE_PANIC: Cell<bool> = Cell::new(false));
15881605
15891606#[ test]
15901607#[ cfg_attr( target_os = "emscripten" , ignore) ] // no threads
1608+ #[ cfg( not( miri) ) ] // Miri does not support panics
15911609fn panic_safe ( ) {
15921610 let prev = panic:: take_hook ( ) ;
15931611 panic:: set_hook ( Box :: new ( move |info| {
0 commit comments