salsa/tests/warnings/needless_lifetimes.rs

26 lines
522 B
Rust
Raw Normal View History

2024-07-18 09:59:43 +00:00
#[salsa::db]
pub trait Db: salsa::Database {}
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct Item {}
2024-07-16 10:04:01 +00:00
#[salsa::tracked]
2024-05-24 00:52:06 +00:00
pub struct SourceTree<'db> {}
2024-07-16 10:04:01 +00:00
#[salsa::tracked]
2024-05-24 00:52:06 +00:00
impl<'db> SourceTree<'db> {
#[salsa::tracked(return_ref)]
2024-05-24 00:52:06 +00:00
pub fn all_items(self, _db: &'db dyn Db) -> Vec<Item> {
todo!()
}
}
2024-07-18 09:59:43 +00:00
#[salsa::tracked(return_ref)]
2024-05-24 00:52:06 +00:00
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);
}