salsa/salsa-2022-tests/tests/warnings/needless_borrow.rs

25 lines
476 B
Rust
Raw Normal View History

2022-08-26 16:51:51 +00:00
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 {
2022-09-04 16:37:45 +00:00
fn fmt(
&self,
_f: &mut std::fmt::Formatter<'_>,
_db: &dyn Db,
_include_all_fields: bool,
) -> std::fmt::Result {
2022-08-26 16:51:51 +00:00
unreachable!()
}
}
#[salsa::tracked(jar = Jar)]
struct TokenTree {
#[return_ref]
tokens: Vec<Token>,
}