From 16563b36661d8af3aa40cedaea20626fdee7ad57 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 28 Sep 2018 15:50:34 -0400 Subject: [PATCH] some more comments --- examples/hello_world/implementation.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/hello_world/implementation.rs b/examples/hello_world/implementation.rs index b42dd9b4..2a63ea0e 100644 --- a/examples/hello_world/implementation.rs +++ b/examples/hello_world/implementation.rs @@ -15,6 +15,8 @@ pub struct QueryContextImpl { execution_stack: RefCell>, } +// This is an example of how you "link up" all the queries in your +// application. query_context_storage! { struct QueryContextImplStorage for storage in QueryContextImpl { impl class_table::ClassTableQueryContext { @@ -25,12 +27,17 @@ query_context_storage! { } } +// This is an example of how you provide custom bits of stuff that +// your queries may need; in this case, an `Interner` value. impl CompilerQueryContext for QueryContextImpl { fn interner(&self) -> &Interner { &self.interner } } +// FIXME: This code... probably should not live here. But maybe we +// just want to provide some helpers or something? I do suspect I want +// people to be able to customize this. impl BaseQueryContext for QueryContextImpl { type QueryDescriptor = DynDescriptor;