From 0bcf47b22b01f66c2f2056f5871e32071ba95b01 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 1 May 2019 23:26:42 +0200 Subject: Update Chalk --- crates/ra_hir/Cargo.toml | 9 +++------ crates/ra_hir/src/ty/method_resolution.rs | 1 - crates/ra_hir/src/ty/traits/chalk.rs | 17 +++++++++++++---- 3 files changed, 16 insertions(+), 11 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index ae7e7df62..68ffcb2e9 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml @@ -21,12 +21,9 @@ tt = { path = "../ra_tt", package = "ra_tt" } test_utils = { path = "../test_utils" } ra_prof = { path = "../ra_prof" } -# chalk-solve = { git = "https://github.com/rust-lang/chalk.git" } -# chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" } -# chalk-ir = { git = "https://github.com/rust-lang/chalk.git" } -chalk-solve = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" } -chalk-rust-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" } -chalk-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" } +chalk-solve = { git = "https://github.com/rust-lang/chalk.git" } +chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" } +chalk-ir = { git = "https://github.com/rust-lang/chalk.git" } [dev-dependencies] flexi_logger = "0.11.0" diff --git a/crates/ra_hir/src/ty/method_resolution.rs b/crates/ra_hir/src/ty/method_resolution.rs index bc5033be6..607e9ba79 100644 --- a/crates/ra_hir/src/ty/method_resolution.rs +++ b/crates/ra_hir/src/ty/method_resolution.rs @@ -202,7 +202,6 @@ fn iterate_trait_method_candidates( } } known_implemented = true; - // TODO the self type is now canonicalized... if let Some(result) = callback(&ty.value, m) { return Some(result); } diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 1adc1d601..c77db9202 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs @@ -40,9 +40,7 @@ impl ToChalk for Ty { Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), // FIXME this is clearly incorrect, but probably not too incorrect // and I'm not sure what to actually do with Ty::Unknown - Ty::Unknown => { - PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty() - }, + Ty::Unknown => PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty(), } } fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self { @@ -189,7 +187,9 @@ where fundamental: false, }; let where_clauses = Vec::new(); // FIXME add where clauses - let trait_datum_bound = chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags }; + let associated_ty_ids = Vec::new(); // FIXME add associated tys + let trait_datum_bound = + chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags, associated_ty_ids }; let trait_datum = TraitDatum { binders: make_binders(trait_datum_bound, bound_vars.len()) }; Arc::new(trait_datum) } @@ -289,6 +289,15 @@ where debug!("split_projection {:?}", projection); unimplemented!() } + fn custom_clauses(&self) -> Vec { + debug!("custom_clauses"); + vec![] + } + fn all_structs(&self) -> Vec { + debug!("all_structs"); + // FIXME + vec![] + } } fn id_from_chalk(chalk_id: chalk_ir::RawId) -> T { -- cgit v1.2.3