mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-23 21:20:05 +00:00
20 lines
410 B
Rust
20 lines
410 B
Rust
|
trait Db: salsa::DbWithJar<Jar> {}
|
||
|
|
||
|
#[salsa::jar(db = Db)]
|
||
|
struct Jar(TokenTree);
|
||
|
|
||
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
|
||
|
enum Token {}
|
||
|
|
||
|
impl salsa::DebugWithDb<dyn Db + '_> for Token {
|
||
|
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>, _db: &dyn Db) -> std::fmt::Result {
|
||
|
unreachable!()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#[salsa::tracked(jar = Jar)]
|
||
|
struct TokenTree {
|
||
|
#[return_ref]
|
||
|
tokens: Vec<Token>,
|
||
|
}
|