2022-08-26 23:51:35 +00:00
|
|
|
//! Test that `specify` does not work if the key is a `salsa::interned`
|
|
|
|
//! compilation fails
|
|
|
|
#![allow(warnings)]
|
|
|
|
|
2024-07-16 10:04:01 +00:00
|
|
|
#[salsa::interned]
|
2024-05-24 01:16:30 +00:00
|
|
|
struct MyInterned<'db> {
|
2022-08-26 23:51:35 +00:00
|
|
|
field: u32,
|
|
|
|
}
|
|
|
|
|
2024-07-16 10:04:01 +00:00
|
|
|
#[salsa::tracked]
|
2024-05-24 01:16:30 +00:00
|
|
|
struct MyTracked<'db> {
|
2022-08-26 23:51:35 +00:00
|
|
|
field: u32,
|
|
|
|
}
|
|
|
|
|
2024-07-19 12:05:39 +00:00
|
|
|
#[salsa::tracked(specify)]
|
|
|
|
fn tracked_fn<'db>(db: &'db dyn salsa::Database, input: MyInterned<'db>) -> MyTracked<'db> {
|
2022-08-26 23:51:35 +00:00
|
|
|
MyTracked::new(db, input.field(db) * 2)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|