Skip to content

Commit dbf32e2

Browse files
committed
Remove flaky test and document the other's flakiness
1 parent 32eedad commit dbf32e2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/liballoc/tests/boxed.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ fn box_clone_and_clone_from_equivalence() {
3434
}
3535
}
3636

37+
/// This test might give a false positive in case the box realocates, but the alocator keeps the
38+
/// original pointer.
39+
///
40+
/// On the other hand it won't give a false negative, if it fails than the memory was definitly not
41+
/// reused
3742
#[test]
3843
fn box_clone_from_ptr_stability() {
3944
for size in (0..8).map(|i| 2usize.pow(i)) {
@@ -43,12 +48,4 @@ fn box_clone_from_ptr_stability() {
4348
copy.clone_from(&control);
4449
assert_eq!(copy.as_ptr() as usize, copy_raw);
4550
}
46-
47-
for size in (0..8).map(|i| 2usize.pow(i)) {
48-
let control = vec![Dummy { _data: 42 }; size].into_boxed_slice();
49-
let mut copy = vec![Dummy { _data: 84 }; size + 1].into_boxed_slice();
50-
let copy_raw = copy.as_ptr() as usize;
51-
copy.clone_from(&control);
52-
assert_ne!(copy.as_ptr() as usize, copy_raw);
53-
}
5451
}

0 commit comments

Comments
 (0)