diff --git a/src/data_race.rs b/src/data_race.rs index 5a6dd1d81d..a27e4c0b90 100644 --- a/src/data_race.rs +++ b/src/data_race.rs @@ -626,7 +626,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> { // of the time, based on `rate`. let rate = this.machine.cmpxchg_weak_failure_rate; let cmpxchg_success = eq.to_scalar()?.to_bool()? - && (!can_fail_spuriously || this.machine.rng.get_mut().gen::() < rate); + && (!can_fail_spuriously || this.machine.rng.get_mut().gen_bool(rate)); let res = Immediate::ScalarPair( old.to_scalar_or_uninit(), Scalar::from_bool(cmpxchg_success).into(),