diff --git a/tests/gc/volatile_tests.rs b/tests/gc/volatile_tests.rs index 9953fdbf..69c47954 100644 --- a/tests/gc/volatile_tests.rs +++ b/tests/gc/volatile_tests.rs @@ -1,34 +1,34 @@ use crate::db; use salsa::{Database, SweepStrategy}; -use std::sync::atomic::{AtomicU32, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; /// Query group for tests for how interned keys interact with GC. #[salsa::query_group(Volatile)] pub(crate) trait VolatileDatabase { #[salsa::input] - fn atomic_cell(&self) -> Arc; + fn atomic_cell(&self) -> Arc; /// Underlying volatile query. #[salsa::volatile] - fn volatile(&self) -> u32; + fn volatile(&self) -> usize; /// This just executes the intern query and returns the result. - fn repeat1(&self) -> u32; + fn repeat1(&self) -> usize; /// Same as `repeat_intern1`. =) - fn repeat2(&self) -> u32; + fn repeat2(&self) -> usize; } -fn volatile(db: &impl VolatileDatabase) -> u32 { +fn volatile(db: &impl VolatileDatabase) -> usize { db.atomic_cell().load(Ordering::SeqCst) } -fn repeat1(db: &impl VolatileDatabase) -> u32 { +fn repeat1(db: &impl VolatileDatabase) -> usize { db.volatile() } -fn repeat2(db: &impl VolatileDatabase) -> u32 { +fn repeat2(db: &impl VolatileDatabase) -> usize { db.volatile() } @@ -36,7 +36,7 @@ fn repeat2(db: &impl VolatileDatabase) -> u32 { fn consistency_no_gc() { let mut db = db::DatabaseImpl::default(); - let cell = Arc::new(AtomicU32::new(22)); + let cell = Arc::new(AtomicUsize::new(22)); db.set_atomic_cell(cell.clone()); @@ -53,7 +53,7 @@ fn consistency_no_gc() { fn consistency_with_gc() { let mut db = db::DatabaseImpl::default(); - let cell = Arc::new(AtomicU32::new(22)); + let cell = Arc::new(AtomicUsize::new(22)); db.set_atomic_cell(cell.clone());