introduce Database::salsa_runtime_mut method (breaking change!)

This commit is contained in:
Niko Matsakis 2019-09-27 05:49:15 -04:00
parent c789219bc5
commit b9f00726da
19 changed files with 100 additions and 17 deletions

View file

@ -27,9 +27,13 @@ pub struct DatabaseImpl {
/// This impl tells salsa where to find the salsa runtime.
impl salsa::Database for DatabaseImpl {
fn salsa_runtime(&self) -> &salsa::Runtime<DatabaseImpl> {
fn salsa_runtime(&self) -> &salsa::Runtime<Self> {
&self.runtime
}
fn salsa_runtime_mut(&mut self) -> &mut salsa::Runtime<Self> {
&mut self.runtime
}
}
/// In addition to the "query provider" traits, you may have other

View file

@ -79,9 +79,13 @@ struct DatabaseStruct {
// Tell salsa where to find the runtime in your context.
impl salsa::Database for DatabaseStruct {
fn salsa_runtime(&self) -> &salsa::Runtime<DatabaseStruct> {
fn salsa_runtime(&self) -> &salsa::Runtime<Self> {
&self.runtime
}
fn salsa_runtime_mut(&mut self) -> &mut salsa::Runtime<Self> {
&mut self.runtime
}
}
// This shows how to use a query.