diff options
-rw-r--r-- | Cargo.lock | 13 | ||||
-rw-r--r-- | crates/ra_hir_ty/Cargo.toml | 6 | ||||
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 20 |
3 files changed, 16 insertions, 23 deletions
diff --git a/Cargo.lock b/Cargo.lock index 97034509f..5a28f7d7d 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -129,7 +129,7 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" | |||
129 | [[package]] | 129 | [[package]] |
130 | name = "chalk-derive" | 130 | name = "chalk-derive" |
131 | version = "0.1.0" | 131 | version = "0.1.0" |
132 | source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" | 132 | source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d" |
133 | dependencies = [ | 133 | dependencies = [ |
134 | "proc-macro2", | 134 | "proc-macro2", |
135 | "quote", | 135 | "quote", |
@@ -139,7 +139,7 @@ dependencies = [ | |||
139 | [[package]] | 139 | [[package]] |
140 | name = "chalk-engine" | 140 | name = "chalk-engine" |
141 | version = "0.9.0" | 141 | version = "0.9.0" |
142 | source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" | 142 | source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d" |
143 | dependencies = [ | 143 | dependencies = [ |
144 | "chalk-macros", | 144 | "chalk-macros", |
145 | "rustc-hash", | 145 | "rustc-hash", |
@@ -148,18 +148,17 @@ dependencies = [ | |||
148 | [[package]] | 148 | [[package]] |
149 | name = "chalk-ir" | 149 | name = "chalk-ir" |
150 | version = "0.1.0" | 150 | version = "0.1.0" |
151 | source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" | 151 | source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d" |
152 | dependencies = [ | 152 | dependencies = [ |
153 | "chalk-derive", | 153 | "chalk-derive", |
154 | "chalk-engine", | 154 | "chalk-engine", |
155 | "chalk-macros", | 155 | "chalk-macros", |
156 | "lalrpop-intern", | ||
157 | ] | 156 | ] |
158 | 157 | ||
159 | [[package]] | 158 | [[package]] |
160 | name = "chalk-macros" | 159 | name = "chalk-macros" |
161 | version = "0.1.1" | 160 | version = "0.1.1" |
162 | source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" | 161 | source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d" |
163 | dependencies = [ | 162 | dependencies = [ |
164 | "lazy_static", | 163 | "lazy_static", |
165 | ] | 164 | ] |
@@ -167,7 +166,7 @@ dependencies = [ | |||
167 | [[package]] | 166 | [[package]] |
168 | name = "chalk-rust-ir" | 167 | name = "chalk-rust-ir" |
169 | version = "0.1.0" | 168 | version = "0.1.0" |
170 | source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" | 169 | source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d" |
171 | dependencies = [ | 170 | dependencies = [ |
172 | "chalk-derive", | 171 | "chalk-derive", |
173 | "chalk-engine", | 172 | "chalk-engine", |
@@ -178,7 +177,7 @@ dependencies = [ | |||
178 | [[package]] | 177 | [[package]] |
179 | name = "chalk-solve" | 178 | name = "chalk-solve" |
180 | version = "0.1.0" | 179 | version = "0.1.0" |
181 | source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" | 180 | source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d" |
182 | dependencies = [ | 181 | dependencies = [ |
183 | "chalk-derive", | 182 | "chalk-derive", |
184 | "chalk-engine", | 183 | "chalk-engine", |
diff --git a/crates/ra_hir_ty/Cargo.toml b/crates/ra_hir_ty/Cargo.toml index 99e2fe1bf..498706168 100644 --- a/crates/ra_hir_ty/Cargo.toml +++ b/crates/ra_hir_ty/Cargo.toml | |||
@@ -21,9 +21,9 @@ ra_prof = { path = "../ra_prof" } | |||
21 | ra_syntax = { path = "../ra_syntax" } | 21 | ra_syntax = { path = "../ra_syntax" } |
22 | test_utils = { path = "../test_utils" } | 22 | test_utils = { path = "../test_utils" } |
23 | 23 | ||
24 | chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "2939913fb7bb94ac2a6721087dc086be11410702" } | 24 | chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "ea1725e6bcf1881ad6c8304941e2282f33d32d1d" } |
25 | chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "2939913fb7bb94ac2a6721087dc086be11410702" } | 25 | chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "ea1725e6bcf1881ad6c8304941e2282f33d32d1d" } |
26 | chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "2939913fb7bb94ac2a6721087dc086be11410702" } | 26 | chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "ea1725e6bcf1881ad6c8304941e2282f33d32d1d" } |
27 | 27 | ||
28 | lalrpop-intern = "0.15.1" | 28 | lalrpop-intern = "0.15.1" |
29 | 29 | ||
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index 4001aa941..7a0f99dec 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs | |||
@@ -27,6 +27,7 @@ impl chalk_ir::interner::Interner for Interner { | |||
27 | type InternedGoal = Arc<GoalData<Self>>; | 27 | type InternedGoal = Arc<GoalData<Self>>; |
28 | type InternedGoals = Vec<Goal<Self>>; | 28 | type InternedGoals = Vec<Goal<Self>>; |
29 | type InternedSubstitution = Vec<Parameter<Self>>; | 29 | type InternedSubstitution = Vec<Parameter<Self>>; |
30 | type Identifier = lalrpop_intern::InternedString; | ||
30 | type DefId = InternId; | 31 | type DefId = InternId; |
31 | 32 | ||
32 | // FIXME: implement these | 33 | // FIXME: implement these |
@@ -121,7 +122,7 @@ pub type StructId = chalk_ir::StructId<Interner>; | |||
121 | pub type StructDatum = chalk_rust_ir::StructDatum<Interner>; | 122 | pub type StructDatum = chalk_rust_ir::StructDatum<Interner>; |
122 | pub type ImplId = chalk_ir::ImplId<Interner>; | 123 | pub type ImplId = chalk_ir::ImplId<Interner>; |
123 | pub type ImplDatum = chalk_rust_ir::ImplDatum<Interner>; | 124 | pub type ImplDatum = chalk_rust_ir::ImplDatum<Interner>; |
124 | pub type AssociatedTyValueId = chalk_rust_ir::AssociatedTyValueId; | 125 | pub type AssociatedTyValueId = chalk_rust_ir::AssociatedTyValueId<Interner>; |
125 | pub type AssociatedTyValue = chalk_rust_ir::AssociatedTyValue<Interner>; | 126 | pub type AssociatedTyValue = chalk_rust_ir::AssociatedTyValue<Interner>; |
126 | 127 | ||
127 | pub(super) trait ToChalk { | 128 | pub(super) trait ToChalk { |
@@ -822,13 +823,6 @@ fn type_alias_associated_ty_value( | |||
822 | Arc::new(value) | 823 | Arc::new(value) |
823 | } | 824 | } |
824 | 825 | ||
825 | fn id_from_chalk<T: InternKey>(chalk_id: chalk_ir::RawId) -> T { | ||
826 | T::from_intern_id(InternId::from(chalk_id.index)) | ||
827 | } | ||
828 | fn id_to_chalk<T: InternKey>(salsa_id: T) -> chalk_ir::RawId { | ||
829 | chalk_ir::RawId { index: salsa_id.as_intern_id().as_u32() } | ||
830 | } | ||
831 | |||
832 | impl From<StructId> for crate::TypeCtorId { | 826 | impl From<StructId> for crate::TypeCtorId { |
833 | fn from(struct_id: StructId) -> Self { | 827 | fn from(struct_id: StructId) -> Self { |
834 | InternKey::from_intern_id(struct_id.0) | 828 | InternKey::from_intern_id(struct_id.0) |
@@ -853,14 +847,14 @@ impl From<crate::traits::GlobalImplId> for ImplId { | |||
853 | } | 847 | } |
854 | } | 848 | } |
855 | 849 | ||
856 | impl From<chalk_rust_ir::AssociatedTyValueId> for crate::traits::AssocTyValueId { | 850 | impl From<chalk_rust_ir::AssociatedTyValueId<Interner>> for crate::traits::AssocTyValueId { |
857 | fn from(id: chalk_rust_ir::AssociatedTyValueId) -> Self { | 851 | fn from(id: chalk_rust_ir::AssociatedTyValueId<Interner>) -> Self { |
858 | id_from_chalk(id.0) | 852 | Self::from_intern_id(id.0) |
859 | } | 853 | } |
860 | } | 854 | } |
861 | 855 | ||
862 | impl From<crate::traits::AssocTyValueId> for chalk_rust_ir::AssociatedTyValueId { | 856 | impl From<crate::traits::AssocTyValueId> for chalk_rust_ir::AssociatedTyValueId<Interner> { |
863 | fn from(assoc_ty_value_id: crate::traits::AssocTyValueId) -> Self { | 857 | fn from(assoc_ty_value_id: crate::traits::AssocTyValueId) -> Self { |
864 | chalk_rust_ir::AssociatedTyValueId(id_to_chalk(assoc_ty_value_id)) | 858 | chalk_rust_ir::AssociatedTyValueId(assoc_ty_value_id.as_intern_id()) |
865 | } | 859 | } |
866 | } | 860 | } |