File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ install:
31
31
build_script :
32
32
- set RUST_TEST_NOCAPTURE=1
33
33
- set RUST_BACKTRACE=1
34
+ - set MIRI_BACKTRACE=1
34
35
- set RUSTFLAGS=-C debug-assertions
35
36
# Build and install miri
36
37
- cargo build --release --all-features --all-targets
@@ -41,7 +42,7 @@ build_script:
41
42
42
43
test_script :
43
44
# Test miri
44
- - cargo test --release --all-features
45
+ - cargo test --release --all-features heap
45
46
# Test cargo integration
46
47
- cd test-cargo-miri
47
48
- ' "C:\msys64\mingw64\bin\python3.exe" run-test.py'
Original file line number Diff line number Diff line change
1
+ // compile-flag: -Zmiri-seed=
1
2
#![ feature( allocator_api) ]
2
3
3
4
use std:: ptr:: NonNull ;
@@ -32,14 +33,15 @@ fn check_overalign_requests<T: Alloc>(mut allocator: T) {
32
33
let size = 8 ;
33
34
// Greater than `size`.
34
35
let align = 16 ;
35
- // Miri is deterministic; no need to try many times.
36
- let iterations = 1 ;
36
+
37
+ let iterations = 5 ;
37
38
unsafe {
38
39
let pointers: Vec < _ > = ( 0 ..iterations) . map ( |_| {
39
40
allocator. alloc ( Layout :: from_size_align ( size, align) . unwrap ( ) ) . unwrap ( )
40
41
} ) . collect ( ) ;
41
42
for & ptr in & pointers {
42
- assert_eq ! ( ( ptr. as_ptr( ) as usize ) % align, 0 ,
43
+ let ptr = ptr. as_ptr ( ) as usize ;
44
+ assert_eq ! ( ptr % align, 0 ,
43
45
"Got a pointer less aligned than requested" )
44
46
}
45
47
@@ -75,7 +77,6 @@ fn box_to_global() {
75
77
fn main ( ) {
76
78
check_alloc ( System ) ;
77
79
check_alloc ( Global ) ;
78
- #[ cfg( not( target_os = "windows" ) ) ] // TODO: Inspects allocation base address on Windows; needs intptrcast model
79
80
check_overalign_requests ( System ) ;
80
81
check_overalign_requests ( Global ) ;
81
82
global_to_box ( ) ;
You can’t perform that action at this time.
0 commit comments