diff options
-rw-r--r-- | Cargo.lock | 46 | ||||
-rw-r--r-- | crates/ra_hir/Cargo.toml | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/infer/unify.rs | 7 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/traits.rs | 2 |
4 files changed, 33 insertions, 28 deletions
diff --git a/Cargo.lock b/Cargo.lock index d8ada0757..8dd894802 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -141,9 +141,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
141 | [[package]] | 141 | [[package]] |
142 | name = "chalk-engine" | 142 | name = "chalk-engine" |
143 | version = "0.9.0" | 143 | version = "0.9.0" |
144 | source = "git+https://github.com/rust-lang/chalk.git#b92c15327f1d336fec7573c7de323ab247cca386" | 144 | source = "git+https://github.com/flodiebold/chalk.git?branch=fuel#fba97af88ff2e0266db12490e2baf47d17e557e3" |
145 | dependencies = [ | 145 | dependencies = [ |
146 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", | 146 | "chalk-macros 0.1.1 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
147 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | 147 | "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", |
148 | "stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | 148 | "stacker 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", |
149 | ] | 149 | ] |
@@ -151,17 +151,17 @@ dependencies = [ | |||
151 | [[package]] | 151 | [[package]] |
152 | name = "chalk-ir" | 152 | name = "chalk-ir" |
153 | version = "0.1.0" | 153 | version = "0.1.0" |
154 | source = "git+https://github.com/rust-lang/chalk.git#b92c15327f1d336fec7573c7de323ab247cca386" | 154 | source = "git+https://github.com/flodiebold/chalk.git?branch=fuel#fba97af88ff2e0266db12490e2baf47d17e557e3" |
155 | dependencies = [ | 155 | dependencies = [ |
156 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", | 156 | "chalk-engine 0.9.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
157 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", | 157 | "chalk-macros 0.1.1 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
158 | "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | 158 | "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", |
159 | ] | 159 | ] |
160 | 160 | ||
161 | [[package]] | 161 | [[package]] |
162 | name = "chalk-macros" | 162 | name = "chalk-macros" |
163 | version = "0.1.1" | 163 | version = "0.1.1" |
164 | source = "git+https://github.com/rust-lang/chalk.git#b92c15327f1d336fec7573c7de323ab247cca386" | 164 | source = "git+https://github.com/flodiebold/chalk.git?branch=fuel#fba97af88ff2e0266db12490e2baf47d17e557e3" |
165 | dependencies = [ | 165 | dependencies = [ |
166 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | 166 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
167 | ] | 167 | ] |
@@ -169,22 +169,22 @@ dependencies = [ | |||
169 | [[package]] | 169 | [[package]] |
170 | name = "chalk-rust-ir" | 170 | name = "chalk-rust-ir" |
171 | version = "0.1.0" | 171 | version = "0.1.0" |
172 | source = "git+https://github.com/rust-lang/chalk.git#b92c15327f1d336fec7573c7de323ab247cca386" | 172 | source = "git+https://github.com/flodiebold/chalk.git?branch=fuel#fba97af88ff2e0266db12490e2baf47d17e557e3" |
173 | dependencies = [ | 173 | dependencies = [ |
174 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", | 174 | "chalk-engine 0.9.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
175 | "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 175 | "chalk-ir 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
176 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", | 176 | "chalk-macros 0.1.1 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
177 | ] | 177 | ] |
178 | 178 | ||
179 | [[package]] | 179 | [[package]] |
180 | name = "chalk-solve" | 180 | name = "chalk-solve" |
181 | version = "0.1.0" | 181 | version = "0.1.0" |
182 | source = "git+https://github.com/rust-lang/chalk.git#b92c15327f1d336fec7573c7de323ab247cca386" | 182 | source = "git+https://github.com/flodiebold/chalk.git?branch=fuel#fba97af88ff2e0266db12490e2baf47d17e557e3" |
183 | dependencies = [ | 183 | dependencies = [ |
184 | "chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)", | 184 | "chalk-engine 0.9.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
185 | "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 185 | "chalk-ir 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
186 | "chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)", | 186 | "chalk-macros 0.1.1 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
187 | "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 187 | "chalk-rust-ir 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
188 | "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", | 188 | "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", |
189 | "ena 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", | 189 | "ena 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", |
190 | "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | 190 | "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1109,9 +1109,9 @@ name = "ra_hir" | |||
1109 | version = "0.1.0" | 1109 | version = "0.1.0" |
1110 | dependencies = [ | 1110 | dependencies = [ |
1111 | "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", | 1111 | "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", |
1112 | "chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 1112 | "chalk-ir 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
1113 | "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 1113 | "chalk-rust-ir 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
1114 | "chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 1114 | "chalk-solve 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)", |
1115 | "ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1115 | "ena 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1116 | "flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", | 1116 | "flexi_logger 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", |
1117 | "insta 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1117 | "insta 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -2036,11 +2036,11 @@ dependencies = [ | |||
2036 | "checksum cargo_metadata 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "178d62b240c34223f265a4c1e275e37d62da163d421fc8d7f7e3ee340f803c57" | 2036 | "checksum cargo_metadata 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "178d62b240c34223f265a4c1e275e37d62da163d421fc8d7f7e3ee340f803c57" |
2037 | "checksum cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a0c56216487bb80eec9c4516337b2588a4f2a2290d72a1416d930e4dcdb0c90d" | 2037 | "checksum cc 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a0c56216487bb80eec9c4516337b2588a4f2a2290d72a1416d930e4dcdb0c90d" |
2038 | "checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4" | 2038 | "checksum cfg-if 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "11d43355396e872eefb45ce6342e4374ed7bc2b3a502d1b28e36d6e23c05d1f4" |
2039 | "checksum chalk-engine 0.9.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 2039 | "checksum chalk-engine 0.9.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)" = "<none>" |
2040 | "checksum chalk-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 2040 | "checksum chalk-ir 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)" = "<none>" |
2041 | "checksum chalk-macros 0.1.1 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 2041 | "checksum chalk-macros 0.1.1 (git+https://github.com/flodiebold/chalk.git?branch=fuel)" = "<none>" |
2042 | "checksum chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 2042 | "checksum chalk-rust-ir 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)" = "<none>" |
2043 | "checksum chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 2043 | "checksum chalk-solve 0.1.0 (git+https://github.com/flodiebold/chalk.git?branch=fuel)" = "<none>" |
2044 | "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" | 2044 | "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" |
2045 | "checksum ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e881307a989a3a5e20d52a32cc05950e3c2178cccfcc9428271a6cde09f902" | 2045 | "checksum ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e881307a989a3a5e20d52a32cc05950e3c2178cccfcc9428271a6cde09f902" |
2046 | "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" | 2046 | "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 cb4a8c3e3..294d047d8 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml | |||
@@ -21,9 +21,9 @@ tt = { path = "../ra_tt", package = "ra_tt" } | |||
21 | test_utils = { path = "../test_utils" } | 21 | test_utils = { path = "../test_utils" } |
22 | ra_prof = { path = "../ra_prof" } | 22 | ra_prof = { path = "../ra_prof" } |
23 | 23 | ||
24 | chalk-solve = { git = "https://github.com/rust-lang/chalk.git" } | 24 | chalk-solve = { git = "https://github.com/flodiebold/chalk.git", branch = "fuel" } |
25 | chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git" } | 25 | chalk-rust-ir = { git = "https://github.com/flodiebold/chalk.git", branch = "fuel" } |
26 | chalk-ir = { git = "https://github.com/rust-lang/chalk.git" } | 26 | chalk-ir = { git = "https://github.com/flodiebold/chalk.git", branch = "fuel" } |
27 | 27 | ||
28 | [dev-dependencies] | 28 | [dev-dependencies] |
29 | flexi_logger = "0.11.0" | 29 | flexi_logger = "0.11.0" |
diff --git a/crates/ra_hir/src/ty/infer/unify.rs b/crates/ra_hir/src/ty/infer/unify.rs index 8ca7e957d..bc9719725 100644 --- a/crates/ra_hir/src/ty/infer/unify.rs +++ b/crates/ra_hir/src/ty/infer/unify.rs | |||
@@ -56,7 +56,12 @@ where | |||
56 | self.var_stack.pop(); | 56 | self.var_stack.pop(); |
57 | result | 57 | result |
58 | } else { | 58 | } else { |
59 | let free_var = InferTy::TypeVar(self.ctx.var_unification_table.find(inner)); | 59 | let root = self.ctx.var_unification_table.find(inner); |
60 | let free_var = match tv { | ||
61 | InferTy::TypeVar(_) => InferTy::TypeVar(root), | ||
62 | InferTy::IntVar(_) => InferTy::IntVar(root), | ||
63 | InferTy::FloatVar(_) => InferTy::FloatVar(root), | ||
64 | }; | ||
60 | let position = self.add(free_var); | 65 | let position = self.add(free_var); |
61 | Ty::Bound(position as u32) | 66 | Ty::Bound(position as u32) |
62 | } | 67 | } |
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs index f39749cab..e6c78c0d4 100644 --- a/crates/ra_hir/src/ty/traits.rs +++ b/crates/ra_hir/src/ty/traits.rs | |||
@@ -61,7 +61,7 @@ fn solve( | |||
61 | let context = ChalkContext { db, krate }; | 61 | let context = ChalkContext { db, krate }; |
62 | let solver = db.solver(krate); | 62 | let solver = db.solver(krate); |
63 | debug!("solve goal: {:?}", goal); | 63 | debug!("solve goal: {:?}", goal); |
64 | let solution = solver.lock().unwrap().solve(&context, goal); | 64 | let solution = solver.lock().unwrap().solve_with_fuel(&context, goal, Some(1000)); |
65 | debug!("solve({:?}) => {:?}", goal, solution); | 65 | debug!("solve({:?}) => {:?}", goal, solution); |
66 | solution | 66 | solution |
67 | } | 67 | } |