salsa/tests/warnings/needless_lifetimes.rs
2024-07-18 06:03:34 -04:00

25 lines
522 B
Rust

#[salsa::db]
pub trait Db: salsa::Database {}
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct Item {}
#[salsa::tracked]
pub struct SourceTree<'db> {}
#[salsa::tracked]
impl<'db> SourceTree<'db> {
#[salsa::tracked(return_ref)]
pub fn all_items(self, _db: &'db dyn Db) -> Vec<Item> {
todo!()
}
}
#[salsa::tracked(return_ref)]
fn use_tree<'db>(_db: &'db dyn Db, _tree: SourceTree<'db>) {}
#[allow(unused)]
fn use_it(db: &dyn Db, tree: SourceTree) {
tree.all_items(db);
use_tree(db, tree);
}