Skip to content

Commit ccbc63b

Browse files
committed
1/1000 events do happen sometimes...
1 parent eb29c9e commit ccbc63b

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct MuchAlign;
77

88
fn main() {
99
// Try many times as this might work by chance.
10-
for _ in 0..10 {
10+
for _ in 0..20 {
1111
let buf = [0u32; 256];
1212
// `buf` is sufficiently aligned for `layout.align` on a `dyn Debug`, but not
1313
// for the actual alignment required by `MuchAlign`.

src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct Foo {
1111

1212
fn main() {
1313
// Try many times as this might work by chance.
14-
for _ in 0..10 {
14+
for _ in 0..20 {
1515
let foo = Foo { x: 42, y: 99 };
1616
let p = &foo.x;
1717
let i = *p; //~ERROR: alignment 4 is required

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn main() {
55
// Try many times as this might work by chance.
6-
for _ in 0..10 {
6+
for _ in 0..20 {
77
let x = [2u16, 3, 4, 5]; // Make it big enough so we don't get an out-of-bounds error.
88
let x = &x[0] as *const _ as *const *const u8; // cast to ptr-to-ptr, so that we load a ptr
99
// This must fail because alignment is violated. Test specifically for loading pointers,

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
// (This would be missed if u8 allocations are *always* at odd addresses.)
77
//
88
// Try many times as this might work by chance.
9-
for _ in 0..10 {
9+
for _ in 0..20 {
1010
let x = [0u8; 4];
1111
let ptr = x.as_ptr().wrapping_offset(1).cast::<u16>();
1212
let _val = unsafe { *ptr }; //~ERROR: but alignment

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fn main() {
66
// Try many times as this might work by chance.
7-
for i in 0..10 {
7+
for i in 0..20 {
88
let x = i as u8;
99
let x = &x as *const _ as *const [u32; 0];
1010
// This must fail because alignment is violated. Test specifically for loading ZST.

src/tools/miri/tests/pass/align.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn align_to() {
2222

2323
fn main() {
2424
// Do this a couple times in a loop because it may work "by chance".
25-
for _ in 0..10 {
25+
for _ in 0..20 {
2626
manual_alignment();
2727
align_to();
2828
}

0 commit comments

Comments
 (0)