Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/query-group-macro/tests/supertrait.rs')
| -rw-r--r-- | crates/query-group-macro/tests/supertrait.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/query-group-macro/tests/supertrait.rs b/crates/query-group-macro/tests/supertrait.rs new file mode 100644 index 0000000000..f7361eaa90 --- /dev/null +++ b/crates/query-group-macro/tests/supertrait.rs @@ -0,0 +1,19 @@ +use query_group_macro::query_group; + +#[salsa::db] +pub trait SourceDb: salsa::Database { + /// Text of the file. + fn file_text(&self, id: usize) -> String; +} + +#[query_group] +pub trait RootDb: SourceDb { + fn parse(&self, id: usize) -> String; +} + +fn parse(db: &dyn RootDb, id: usize) -> String { + // this is the test: does the following compile? + db.file_text(id); + + String::new() +} |