aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-05-01 22:26:42 +0100
committerFlorian Diebold <[email protected]>2019-05-04 17:18:30 +0100
commit0bcf47b22b01f66c2f2056f5871e32071ba95b01 (patch)
tree725e7b508affd7c810a4459495065ac3ecff5285 /crates/ra_hir
parent0f34568924019caf1ed63c84143c12156b963abf (diff)
Update Chalk
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/Cargo.toml9
-rw-r--r--crates/ra_hir/src/ty/method_resolution.rs1
-rw-r--r--crates/ra_hir/src/ty/traits/chalk.rs17
3 files changed, 16 insertions, 11 deletions
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" }
21test_utils = { path = "../test_utils" } 21test_utils = { path = "../test_utils" }
22ra_prof = { path = "../ra_prof" } 22ra_prof = { path = "../ra_prof" }
23 23
24# chalk-solve = { git = "https://github.com/rust-lang/chalk.git" } 24chalk-solve = { git = "https://github.com/rust-lang/chalk.git" }
25# chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" } 25chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" }
26# chalk-ir = { git = "https://github.com/rust-lang/chalk.git" } 26chalk-ir = { git = "https://github.com/rust-lang/chalk.git" }
27chalk-solve = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" }
28chalk-rust-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" }
29chalk-ir = { git = "https://github.com/detrumi/chalk.git", branch = "program_clauses_that_could_match" }
30 27
31[dev-dependencies] 28[dev-dependencies]
32flexi_logger = "0.11.0" 29flexi_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<T>(
202 } 202 }
203 } 203 }
204 known_implemented = true; 204 known_implemented = true;
205 // TODO the self type is now canonicalized...
206 if let Some(result) = callback(&ty.value, m) { 205 if let Some(result) = callback(&ty.value, m) {
207 return Some(result); 206 return Some(result);
208 } 207 }
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 {
40 Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), 40 Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"),
41 // FIXME this is clearly incorrect, but probably not too incorrect 41 // FIXME this is clearly incorrect, but probably not too incorrect
42 // and I'm not sure what to actually do with Ty::Unknown 42 // and I'm not sure what to actually do with Ty::Unknown
43 Ty::Unknown => { 43 Ty::Unknown => PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty(),
44 PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty()
45 },
46 } 44 }
47 } 45 }
48 fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self { 46 fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self {
@@ -189,7 +187,9 @@ where
189 fundamental: false, 187 fundamental: false,
190 }; 188 };
191 let where_clauses = Vec::new(); // FIXME add where clauses 189 let where_clauses = Vec::new(); // FIXME add where clauses
192 let trait_datum_bound = chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags }; 190 let associated_ty_ids = Vec::new(); // FIXME add associated tys
191 let trait_datum_bound =
192 chalk_rust_ir::TraitDatumBound { trait_ref, where_clauses, flags, associated_ty_ids };
193 let trait_datum = TraitDatum { binders: make_binders(trait_datum_bound, bound_vars.len()) }; 193 let trait_datum = TraitDatum { binders: make_binders(trait_datum_bound, bound_vars.len()) };
194 Arc::new(trait_datum) 194 Arc::new(trait_datum)
195 } 195 }
@@ -289,6 +289,15 @@ where
289 debug!("split_projection {:?}", projection); 289 debug!("split_projection {:?}", projection);
290 unimplemented!() 290 unimplemented!()
291 } 291 }
292 fn custom_clauses(&self) -> Vec<chalk_ir::ProgramClause> {
293 debug!("custom_clauses");
294 vec![]
295 }
296 fn all_structs(&self) -> Vec<chalk_ir::StructId> {
297 debug!("all_structs");
298 // FIXME
299 vec![]
300 }
292} 301}
293 302
294fn id_from_chalk<T: InternKey>(chalk_id: chalk_ir::RawId) -> T { 303fn id_from_chalk<T: InternKey>(chalk_id: chalk_ir::RawId) -> T {