1
- #![ cfg( not( miri) ) ]
2
-
3
1
use std:: cell:: Cell ;
4
2
use std:: cmp:: Ordering :: { self , Equal , Greater , Less } ;
5
3
use std:: mem;
@@ -260,6 +258,7 @@ fn test_swap_remove() {
260
258
261
259
#[ test]
262
260
#[ should_panic]
261
+ #[ cfg( not( miri) ) ] // Miri does not support panics
263
262
fn test_swap_remove_fail ( ) {
264
263
let mut v = vec ! [ 1 ] ;
265
264
let _ = v. swap_remove ( 0 ) ;
@@ -391,6 +390,7 @@ fn test_reverse() {
391
390
}
392
391
393
392
#[ test]
393
+ #[ cfg( not( miri) ) ] // Miri does not support entropy
394
394
fn test_sort ( ) {
395
395
let mut rng = thread_rng ( ) ;
396
396
@@ -467,6 +467,7 @@ fn test_sort() {
467
467
}
468
468
469
469
#[ test]
470
+ #[ cfg( not( miri) ) ] // Miri does not support entropy
470
471
fn test_sort_stability ( ) {
471
472
for len in ( 2 ..25 ) . chain ( 500 ..510 ) {
472
473
for _ in 0 ..10 {
@@ -631,6 +632,7 @@ fn test_insert() {
631
632
632
633
#[ test]
633
634
#[ should_panic]
635
+ #[ cfg( not( miri) ) ] // Miri does not support panics
634
636
fn test_insert_oob ( ) {
635
637
let mut a = vec ! [ 1 , 2 , 3 ] ;
636
638
a. insert ( 4 , 5 ) ;
@@ -655,6 +657,7 @@ fn test_remove() {
655
657
656
658
#[ test]
657
659
#[ should_panic]
660
+ #[ cfg( not( miri) ) ] // Miri does not support panics
658
661
fn test_remove_fail ( ) {
659
662
let mut a = vec ! [ 1 ] ;
660
663
let _ = a. remove ( 0 ) ;
@@ -936,6 +939,7 @@ fn test_windowsator() {
936
939
937
940
#[ test]
938
941
#[ should_panic]
942
+ #[ cfg( not( miri) ) ] // Miri does not support panics
939
943
fn test_windowsator_0 ( ) {
940
944
let v = & [ 1 , 2 , 3 , 4 ] ;
941
945
let _it = v. windows ( 0 ) ;
@@ -960,6 +964,7 @@ fn test_chunksator() {
960
964
961
965
#[ test]
962
966
#[ should_panic]
967
+ #[ cfg( not( miri) ) ] // Miri does not support panics
963
968
fn test_chunksator_0 ( ) {
964
969
let v = & [ 1 , 2 , 3 , 4 ] ;
965
970
let _it = v. chunks ( 0 ) ;
@@ -984,6 +989,7 @@ fn test_chunks_exactator() {
984
989
985
990
#[ test]
986
991
#[ should_panic]
992
+ #[ cfg( not( miri) ) ] // Miri does not support panics
987
993
fn test_chunks_exactator_0 ( ) {
988
994
let v = & [ 1 , 2 , 3 , 4 ] ;
989
995
let _it = v. chunks_exact ( 0 ) ;
@@ -1008,6 +1014,7 @@ fn test_rchunksator() {
1008
1014
1009
1015
#[ test]
1010
1016
#[ should_panic]
1017
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1011
1018
fn test_rchunksator_0 ( ) {
1012
1019
let v = & [ 1 , 2 , 3 , 4 ] ;
1013
1020
let _it = v. rchunks ( 0 ) ;
@@ -1032,6 +1039,7 @@ fn test_rchunks_exactator() {
1032
1039
1033
1040
#[ test]
1034
1041
#[ should_panic]
1042
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1035
1043
fn test_rchunks_exactator_0 ( ) {
1036
1044
let v = & [ 1 , 2 , 3 , 4 ] ;
1037
1045
let _it = v. rchunks_exact ( 0 ) ;
@@ -1084,6 +1092,7 @@ fn test_vec_default() {
1084
1092
1085
1093
#[ test]
1086
1094
#[ should_panic]
1095
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1087
1096
fn test_overflow_does_not_cause_segfault ( ) {
1088
1097
let mut v = vec ! [ ] ;
1089
1098
v. reserve_exact ( !0 ) ;
@@ -1093,6 +1102,7 @@ fn test_overflow_does_not_cause_segfault() {
1093
1102
1094
1103
#[ test]
1095
1104
#[ should_panic]
1105
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1096
1106
fn test_overflow_does_not_cause_segfault_managed ( ) {
1097
1107
let mut v = vec ! [ Rc :: new( 1 ) ] ;
1098
1108
v. reserve_exact ( !0 ) ;
@@ -1268,6 +1278,7 @@ fn test_mut_chunks_rev() {
1268
1278
1269
1279
#[ test]
1270
1280
#[ should_panic]
1281
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1271
1282
fn test_mut_chunks_0 ( ) {
1272
1283
let mut v = [ 1 , 2 , 3 , 4 ] ;
1273
1284
let _it = v. chunks_mut ( 0 ) ;
@@ -1300,6 +1311,7 @@ fn test_mut_chunks_exact_rev() {
1300
1311
1301
1312
#[ test]
1302
1313
#[ should_panic]
1314
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1303
1315
fn test_mut_chunks_exact_0 ( ) {
1304
1316
let mut v = [ 1 , 2 , 3 , 4 ] ;
1305
1317
let _it = v. chunks_exact_mut ( 0 ) ;
@@ -1332,6 +1344,7 @@ fn test_mut_rchunks_rev() {
1332
1344
1333
1345
#[ test]
1334
1346
#[ should_panic]
1347
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1335
1348
fn test_mut_rchunks_0 ( ) {
1336
1349
let mut v = [ 1 , 2 , 3 , 4 ] ;
1337
1350
let _it = v. rchunks_mut ( 0 ) ;
@@ -1364,6 +1377,7 @@ fn test_mut_rchunks_exact_rev() {
1364
1377
1365
1378
#[ test]
1366
1379
#[ should_panic]
1380
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1367
1381
fn test_mut_rchunks_exact_0 ( ) {
1368
1382
let mut v = [ 1 , 2 , 3 , 4 ] ;
1369
1383
let _it = v. rchunks_exact_mut ( 0 ) ;
@@ -1397,6 +1411,7 @@ fn test_box_slice_clone() {
1397
1411
#[ test]
1398
1412
#[ allow( unused_must_use) ] // here, we care about the side effects of `.clone()`
1399
1413
#[ cfg_attr( target_os = "emscripten" , ignore) ]
1414
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1400
1415
fn test_box_slice_clone_panics ( ) {
1401
1416
use std:: sync:: Arc ;
1402
1417
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
@@ -1461,6 +1476,7 @@ fn test_copy_from_slice() {
1461
1476
1462
1477
#[ test]
1463
1478
#[ should_panic( expected = "destination and source slices have different lengths" ) ]
1479
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1464
1480
fn test_copy_from_slice_dst_longer ( ) {
1465
1481
let src = [ 0 , 1 , 2 , 3 ] ;
1466
1482
let mut dst = [ 0 ; 5 ] ;
@@ -1469,6 +1485,7 @@ fn test_copy_from_slice_dst_longer() {
1469
1485
1470
1486
#[ test]
1471
1487
#[ should_panic( expected = "destination and source slices have different lengths" ) ]
1488
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1472
1489
fn test_copy_from_slice_dst_shorter ( ) {
1473
1490
let src = [ 0 , 1 , 2 , 3 ] ;
1474
1491
let mut dst = [ 0 ; 3 ] ;
@@ -1588,6 +1605,7 @@ thread_local!(static SILENCE_PANIC: Cell<bool> = Cell::new(false));
1588
1605
1589
1606
#[ test]
1590
1607
#[ cfg_attr( target_os = "emscripten" , ignore) ] // no threads
1608
+ #[ cfg( not( miri) ) ] // Miri does not support panics
1591
1609
fn panic_safe ( ) {
1592
1610
let prev = panic:: take_hook ( ) ;
1593
1611
panic:: set_hook ( Box :: new ( move |info| {
0 commit comments