mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-02 04:48:13 +00:00
internal: vendor query-group-macro
This commit is contained in:
parent
bd0289e0e9
commit
7a7ff470ca
17 changed files with 1989 additions and 22 deletions
19
crates/query-group-macro/tests/supertrait.rs
Normal file
19
crates/query-group-macro/tests/supertrait.rs
Normal file
|
|
@ -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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue