File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ jobs:
123
123
run : rustup component add rust-src
124
124
- name : ASAN / TSAN
125
125
run : . ci/tsan.sh
126
+ miri :
127
+ name : miri
128
+ runs-on : ubuntu-latest
129
+ steps :
130
+ - uses : actions/checkout@v2
131
+ - name : Miri
132
+ run : ci/miri.sh
126
133
127
134
# Loom
128
135
loom :
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -e
3
+
4
+ MIRI_NIGHTLY=nightly-$( curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
5
+ echo " Installing latest nightly with Miri: $MIRI_NIGHTLY "
6
+ rustup set profile minimal
7
+ rustup default " $MIRI_NIGHTLY "
8
+ rustup component add miri
9
+
10
+ cargo miri test
11
+ cargo miri test --target mips64-unknown-linux-gnuabi64
Original file line number Diff line number Diff line change @@ -461,6 +461,7 @@ fn reserve_allocates_at_least_original_capacity() {
461
461
}
462
462
463
463
#[ test]
464
+ #[ cfg_attr( miri, ignore) ] // Miri is too slow
464
465
fn reserve_max_original_capacity_value ( ) {
465
466
const SIZE : usize = 128 * 1024 ;
466
467
@@ -608,15 +609,15 @@ fn advance_past_len() {
608
609
609
610
#[ test]
610
611
// Only run these tests on little endian systems. CI uses qemu for testing
611
- // little endian... and qemu doesn't really support threading all that well.
612
- #[ cfg( target_endian = "little" ) ]
612
+ // big endian... and qemu doesn't really support threading all that well.
613
+ #[ cfg( any ( miri , target_endian = "little" ) ) ]
613
614
fn stress ( ) {
614
615
// Tests promoting a buffer from a vec -> shared in a concurrent situation
615
616
use std:: sync:: { Arc , Barrier } ;
616
617
use std:: thread;
617
618
618
619
const THREADS : usize = 8 ;
619
- const ITERS : usize = 1_000 ;
620
+ const ITERS : usize = if cfg ! ( miri ) { 100 } else { 1_000 } ;
620
621
621
622
for i in 0 ..ITERS {
622
623
let data = [ i as u8 ; 256 ] ;
Original file line number Diff line number Diff line change 1
1
//! Test using `Bytes` with an allocator that hands out "odd" pointers for
2
2
//! vectors (pointers where the LSB is set).
3
3
4
+ #![ cfg( not( miri) ) ] // Miri does not support custom allocators (also, Miri is "odd" by default with 50% chance)
5
+
4
6
use std:: alloc:: { GlobalAlloc , Layout , System } ;
5
7
use std:: ptr;
6
8
You can’t perform that action at this time.
0 commit comments