aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock46
-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
4 files changed, 39 insertions, 34 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 0bb62cb88..98c349dec 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -146,9 +146,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
146[[package]] 146[[package]]
147name = "chalk-engine" 147name = "chalk-engine"
148version = "0.9.0" 148version = "0.9.0"
149source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" 149source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
150dependencies = [ 150dependencies = [
151 "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 151 "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
152 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 152 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
153 "stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 153 "stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
154] 154]
@@ -156,17 +156,17 @@ dependencies = [
156[[package]] 156[[package]]
157name = "chalk-ir" 157name = "chalk-ir"
158version = "0.1.0" 158version = "0.1.0"
159source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" 159source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
160dependencies = [ 160dependencies = [
161 "chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 161 "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)",
162 "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 162 "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
163 "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", 163 "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
164] 164]
165 165
166[[package]] 166[[package]]
167name = "chalk-macros" 167name = "chalk-macros"
168version = "0.1.1" 168version = "0.1.1"
169source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" 169source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
170dependencies = [ 170dependencies = [
171 "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 171 "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
172] 172]
@@ -174,22 +174,22 @@ dependencies = [
174[[package]] 174[[package]]
175name = "chalk-rust-ir" 175name = "chalk-rust-ir"
176version = "0.1.0" 176version = "0.1.0"
177source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" 177source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
178dependencies = [ 178dependencies = [
179 "chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 179 "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)",
180 "chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 180 "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
181 "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 181 "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
182] 182]
183 183
184[[package]] 184[[package]]
185name = "chalk-solve" 185name = "chalk-solve"
186version = "0.1.0" 186version = "0.1.0"
187source = "git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match#b508031b92c754a677d46236aae1dcd2fa2fd68a" 187source = "git+https://github.com/rust-lang/chalk.git#17fb07e43b23d721f9c1adba289eac71b25f38ef"
188dependencies = [ 188dependencies = [
189 "chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 189 "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)",
190 "chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 190 "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
191 "chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 191 "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)",
192 "chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 192 "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
193 "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", 193 "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
194 "ena 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", 194 "ena 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
195 "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 195 "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1074,9 +1074,9 @@ name = "ra_hir"
1074version = "0.1.0" 1074version = "0.1.0"
1075dependencies = [ 1075dependencies = [
1076 "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", 1076 "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
1077 "chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 1077 "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
1078 "chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 1078 "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
1079 "chalk-solve 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)", 1079 "chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)",
1080 "ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 1080 "ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
1081 "flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", 1081 "flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)",
1082 "insta 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", 1082 "insta 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1997,11 +1997,11 @@ dependencies = [
1997"checksum cargo_metadata 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "178d62b240c34223f265a4c1e275e37d62da163d421fc8d7f7e3ee340f803c57" 1997"checksum cargo_metadata 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "178d62b240c34223f265a4c1e275e37d62da163d421fc8d7f7e3ee340f803c57"
1998"checksum cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "5e5f3fee5eeb60324c2781f1e41286bdee933850fff9b3c672587fed5ec58c83" 1998"checksum cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)" = "5e5f3fee5eeb60324c2781f1e41286bdee933850fff9b3c672587fed5ec58c83"
1999"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4" 1999"checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4"
2000"checksum chalk-engine 0.9.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>" 2000"checksum chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
2001"checksum chalk-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>" 2001"checksum chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
2002"checksum chalk-macros 0.1.1 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>" 2002"checksum chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
2003"checksum chalk-rust-ir 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>" 2003"checksum chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
2004"checksum chalk-solve 0.1.0 (git+https://github.com/detrumi/chalk.git?branch=program_clauses_that_could_match)" = "<none>" 2004"checksum chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>"
2005"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" 2005"checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878"
2006"checksum ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e881307a989a3a5e20d52a32cc05950e3c2178cccfcc9428271a6cde09f902" 2006"checksum ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e881307a989a3a5e20d52a32cc05950e3c2178cccfcc9428271a6cde09f902"
2007"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" 2007"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
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 {