mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
re-enable chalk
This commit is contained in:
parent
26463f189f
commit
ed943adb29
1 changed files with 16 additions and 17 deletions
|
@ -78,24 +78,23 @@ pub enum Obligation {
|
||||||
|
|
||||||
/// Check using Chalk whether trait is implemented for given parameters including `Self` type.
|
/// Check using Chalk whether trait is implemented for given parameters including `Self` type.
|
||||||
pub(crate) fn implements_query(
|
pub(crate) fn implements_query(
|
||||||
_db: &impl HirDatabase,
|
db: &impl HirDatabase,
|
||||||
_krate: Crate,
|
krate: Crate,
|
||||||
_trait_ref: Canonical<TraitRef>,
|
trait_ref: Canonical<TraitRef>,
|
||||||
) -> Option<Solution> {
|
) -> Option<Solution> {
|
||||||
return None;
|
let _p = profile("implements_query");
|
||||||
// let _p = profile("implements_query");
|
let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast();
|
||||||
// let goal: chalk_ir::Goal = trait_ref.value.to_chalk(db).cast();
|
debug!("goal: {:?}", goal);
|
||||||
// debug!("goal: {:?}", goal);
|
let env = chalk_ir::Environment::new();
|
||||||
// let env = chalk_ir::Environment::new();
|
let in_env = chalk_ir::InEnvironment::new(&env, goal);
|
||||||
// let in_env = chalk_ir::InEnvironment::new(&env, goal);
|
let parameter = chalk_ir::ParameterKind::Ty(chalk_ir::UniverseIndex::ROOT);
|
||||||
// let parameter = chalk_ir::ParameterKind::Ty(chalk_ir::UniverseIndex::ROOT);
|
let canonical =
|
||||||
// let canonical =
|
chalk_ir::Canonical { value: in_env, binders: vec![parameter; trait_ref.num_vars] };
|
||||||
// chalk_ir::Canonical { value: in_env, binders: vec![parameter; trait_ref.num_vars] };
|
// We currently don't deal with universes (I think / hope they're not yet
|
||||||
// // We currently don't deal with universes (I think / hope they're not yet
|
// relevant for our use cases?)
|
||||||
// // relevant for our use cases?)
|
let u_canonical = chalk_ir::UCanonical { canonical, universes: 1 };
|
||||||
// let u_canonical = chalk_ir::UCanonical { canonical, universes: 1 };
|
let solution = solve(db, krate, &u_canonical);
|
||||||
// let solution = solve(db, krate, &u_canonical);
|
solution.map(|solution| solution_from_chalk(db, solution))
|
||||||
// solution.map(|solution| solution_from_chalk(db, solution))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn solution_from_chalk(db: &impl HirDatabase, solution: chalk_solve::Solution) -> Solution {
|
fn solution_from_chalk(db: &impl HirDatabase, solution: chalk_solve::Solution) -> Solution {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue