Adapt rustc_data_structures tests to run in strict miri
Some tests took too long and owning_ref is fundamentally flawed, so don't run these tests or run them with a shorter N. This makes miri with `-Zmiri-strict-provenance` usable to find UB.
This commit is contained in:
parent
44e9516c85
commit
fc8b13cb96
3 changed files with 10 additions and 1 deletions
|
@ -15,7 +15,9 @@ fn test_encode() {
|
|||
test(u64::MAX as u128, base);
|
||||
test(u128::MAX, base);
|
||||
|
||||
for i in 0..1_000 {
|
||||
const N: u128 = if cfg!(miri) { 10 } else { 1000 };
|
||||
|
||||
for i in 0..N {
|
||||
test(i * 983, base);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,7 +156,10 @@ fn test_deep_linear() {
|
|||
v
|
||||
…
|
||||
*/
|
||||
#[cfg(not(miri))]
|
||||
const NR_NODES: usize = 1 << 14;
|
||||
#[cfg(miri)]
|
||||
const NR_NODES: usize = 1 << 3;
|
||||
let mut nodes = vec![];
|
||||
for i in 1..NR_NODES {
|
||||
nodes.push((i - 1, i));
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// FIXME: owning_ref is not sound under stacked borrows. Preferably, get rid of it.
|
||||
#[cfg(not(miri))]
|
||||
mod owning_ref {
|
||||
use super::super::OwningRef;
|
||||
use super::super::{BoxRef, Erased, ErasedBoxRef, RcRef};
|
||||
|
@ -361,6 +363,8 @@ mod owning_handle {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME: owning_ref is not sound under stacked borrows. Preferably, get rid of it.
|
||||
#[cfg(not(miri))]
|
||||
mod owning_ref_mut {
|
||||
use super::super::BoxRef;
|
||||
use super::super::{BoxRefMut, Erased, ErasedBoxRefMut, OwningRefMut};
|
||||
|
|
Loading…
Add table
Reference in a new issue