salsa/tests/compile-fail/specify-does-not-work-if-the-key-is-a-salsa-input.rs
Niko Matsakis 68a3a7fceb wip
2024-07-19 08:05:39 -04:00

20 lines
397 B
Rust

//! Test that `specify` does not work if the key is a `salsa::input`
//! compilation fails
#![allow(warnings)]
#[salsa::input]
struct MyInput {
field: u32,
}
#[salsa::tracked]
struct MyTracked<'db> {
field: u32,
}
#[salsa::tracked(specify)]
fn tracked_fn<'db>(db: &'db dyn salsa::Database, input: MyInput) -> MyTracked<'db> {
MyTracked::new(db, input.field(db) * 2)
}
fn main() {}