add _query to query functions

This commit is contained in:
Aleksey Kladov 2019-05-21 12:44:08 +03:00
parent eabfe3902f
commit 69341a0bbe
2 changed files with 6 additions and 6 deletions

View File

@ -156,7 +156,7 @@ fn body_with_source_map(
#[salsa::invoke(crate::ty::method_resolution::CrateImplBlocks::impls_in_crate_query)]
fn impls_in_crate(&self, krate: Crate) -> Arc<CrateImplBlocks>;
#[salsa::invoke(crate::ty::traits::impls_for_trait)]
#[salsa::invoke(crate::ty::traits::impls_for_trait_query)]
fn impls_for_trait(&self, krate: Crate, trait_: Trait) -> Arc<[ImplBlock]>;
/// This provides the Chalk trait solver instance. Because Chalk always
@ -164,11 +164,11 @@ fn body_with_source_map(
/// because Chalk does its own internal caching, the solver is wrapped in a
/// Mutex and the query is marked volatile, to make sure the cached state is
/// thrown away when input facts change.
#[salsa::invoke(crate::ty::traits::solver)]
#[salsa::invoke(crate::ty::traits::solver_query)]
#[salsa::volatile]
fn solver(&self, krate: Crate) -> Arc<Mutex<crate::ty::traits::Solver>>;
#[salsa::invoke(crate::ty::traits::implements)]
#[salsa::invoke(crate::ty::traits::implements_query)]
fn implements(
&self,
krate: Crate,

View File

@ -25,7 +25,7 @@ struct ChalkContext<'a, DB> {
krate: Crate,
}
pub(crate) fn solver(_db: &impl HirDatabase, _krate: Crate) -> Arc<Mutex<Solver>> {
pub(crate) fn solver_query(_db: &impl HirDatabase, _krate: Crate) -> Arc<Mutex<Solver>> {
// krate parameter is just so we cache a unique solver per crate
let solver_choice = chalk_solve::SolverChoice::SLG { max_size: CHALK_SOLVER_MAX_SIZE };
debug!("Creating new solver for crate {:?}", _krate);
@ -33,7 +33,7 @@ pub(crate) fn solver(_db: &impl HirDatabase, _krate: Crate) -> Arc<Mutex<Solver>
}
/// Collects impls for the given trait in the whole dependency tree of `krate`.
pub(crate) fn impls_for_trait(
pub(crate) fn impls_for_trait_query(
db: &impl HirDatabase,
krate: Crate,
trait_: Trait,
@ -76,7 +76,7 @@ pub enum Obligation {
}
/// Check using Chalk whether trait is implemented for given parameters including `Self` type.
pub(crate) fn implements(
pub(crate) fn implements_query(
db: &impl HirDatabase,
krate: Crate,
trait_ref: Canonical<TraitRef>,