salsa/tests/compile-fail/span-tracked-getter.rs

16 lines
250 B
Rust
Raw Normal View History

2024-04-04 10:21:33 +00:00
#[salsa::tracked]
2024-05-24 01:16:30 +00:00
pub struct MyTracked<'db> {
2024-04-04 10:21:33 +00:00
field: u32,
}
#[salsa::tracked]
2024-07-19 12:05:39 +00:00
fn my_fn(db: &dyn salsa::Database) {
2024-04-04 10:21:33 +00:00
let x = MyTracked::new(db, 22);
x.field(22);
}
fn main() {
2024-07-19 12:05:39 +00:00
let mut db = salsa::default_database();
2024-04-04 10:21:33 +00:00
my_fn(&db);
}