salsa/tests/compile-fail/tracked_fn_incompatibles.rs

38 lines
790 B
Rust
Raw Normal View History

2024-07-19 12:05:39 +00:00
use salsa::Database as Db;
2024-07-16 10:04:01 +00:00
#[salsa::input]
struct MyInput {
field: u32,
}
2024-07-19 12:05:39 +00:00
#[salsa::tracked(data = Data)]
fn tracked_fn_with_data(db: &dyn Db, input: MyInput) -> u32 {
input.field(db) * 2
}
2024-07-19 12:05:39 +00:00
#[salsa::tracked(db = Db)]
fn tracked_fn_with_db(db: &dyn Db, input: MyInput) -> u32 {
input.field(db) * 2
}
2024-07-19 12:05:39 +00:00
#[salsa::tracked(constructor = TrackedFn3)]
fn tracked_fn_with_constructor(db: &dyn Db, input: MyInput) -> u32 {
input.field(db) * 2
}
2024-07-16 10:04:01 +00:00
#[salsa::tracked]
fn tracked_fn_with_one_input(db: &dyn Db) -> u32 {}
2024-07-16 10:04:01 +00:00
#[salsa::tracked]
fn tracked_fn_with_receiver_not_applied_to_impl_block(&self, db: &dyn Db) -> u32 {}
2024-07-19 12:05:39 +00:00
#[salsa::tracked(specify)]
fn tracked_fn_with_too_many_arguments_for_specify(
db: &dyn Db,
input: MyInput,
input: MyInput,
) -> u32 {
}
fn main() {}