salsa/examples/compiler/main.rs

24 lines
487 B
Rust
Raw Normal View History

2018-09-28 15:26:53 +00:00
mod class_table;
mod compiler;
2018-09-28 15:40:20 +00:00
mod implementation;
2018-10-05 08:54:51 +00:00
use self::class_table::ClassTableDatabase;
use self::implementation::DatabaseImpl;
2018-09-28 15:26:53 +00:00
2018-09-28 17:54:40 +00:00
#[test]
fn test() {
2018-10-05 08:54:51 +00:00
let query = DatabaseImpl::default();
2018-10-19 01:26:48 +00:00
let all_def_ids = query.all_fields();
2018-09-28 17:54:40 +00:00
assert_eq!(
format!("{:?}", all_def_ids),
"[DefId(1), DefId(2), DefId(11), DefId(12)]"
);
}
2018-09-28 15:26:53 +00:00
fn main() {
2018-10-05 08:54:51 +00:00
let query = DatabaseImpl::default();
2018-10-19 01:26:48 +00:00
for f in query.all_fields().iter() {
2018-09-28 15:40:20 +00:00
println!("{:?}", f);
}
2018-09-28 15:26:53 +00:00
}