aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurenČ›iu Nicola <[email protected]>2020-03-02 21:30:38 +0000
committerLaurenČ›iu Nicola <[email protected]>2020-03-02 21:30:38 +0000
commit807a56bebfecf6f655c48c3490c296180045c44b (patch)
tree3470601cb157d60844039a68ce98dbd423c0199d
parent1eeb7a79bb0d47566c82c70e424084fb0dfec1bc (diff)
Update chalk for RawId removal
-rw-r--r--Cargo.lock13
-rw-r--r--crates/ra_hir_ty/Cargo.toml6
-rw-r--r--crates/ra_hir_ty/src/traits/chalk.rs20
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]]
130name = "chalk-derive" 130name = "chalk-derive"
131version = "0.1.0" 131version = "0.1.0"
132source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" 132source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d"
133dependencies = [ 133dependencies = [
134 "proc-macro2", 134 "proc-macro2",
135 "quote", 135 "quote",
@@ -139,7 +139,7 @@ dependencies = [
139[[package]] 139[[package]]
140name = "chalk-engine" 140name = "chalk-engine"
141version = "0.9.0" 141version = "0.9.0"
142source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" 142source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d"
143dependencies = [ 143dependencies = [
144 "chalk-macros", 144 "chalk-macros",
145 "rustc-hash", 145 "rustc-hash",
@@ -148,18 +148,17 @@ dependencies = [
148[[package]] 148[[package]]
149name = "chalk-ir" 149name = "chalk-ir"
150version = "0.1.0" 150version = "0.1.0"
151source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" 151source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d"
152dependencies = [ 152dependencies = [
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]]
160name = "chalk-macros" 159name = "chalk-macros"
161version = "0.1.1" 160version = "0.1.1"
162source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" 161source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d"
163dependencies = [ 162dependencies = [
164 "lazy_static", 163 "lazy_static",
165] 164]
@@ -167,7 +166,7 @@ dependencies = [
167[[package]] 166[[package]]
168name = "chalk-rust-ir" 167name = "chalk-rust-ir"
169version = "0.1.0" 168version = "0.1.0"
170source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" 169source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d"
171dependencies = [ 170dependencies = [
172 "chalk-derive", 171 "chalk-derive",
173 "chalk-engine", 172 "chalk-engine",
@@ -178,7 +177,7 @@ dependencies = [
178[[package]] 177[[package]]
179name = "chalk-solve" 178name = "chalk-solve"
180version = "0.1.0" 179version = "0.1.0"
181source = "git+https://github.com/rust-lang/chalk.git?rev=2939913fb7bb94ac2a6721087dc086be11410702#2939913fb7bb94ac2a6721087dc086be11410702" 180source = "git+https://github.com/rust-lang/chalk.git?rev=ea1725e6bcf1881ad6c8304941e2282f33d32d1d#ea1725e6bcf1881ad6c8304941e2282f33d32d1d"
182dependencies = [ 181dependencies = [
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" }
21ra_syntax = { path = "../ra_syntax" } 21ra_syntax = { path = "../ra_syntax" }
22test_utils = { path = "../test_utils" } 22test_utils = { path = "../test_utils" }
23 23
24chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "2939913fb7bb94ac2a6721087dc086be11410702" } 24chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev = "ea1725e6bcf1881ad6c8304941e2282f33d32d1d" }
25chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "2939913fb7bb94ac2a6721087dc086be11410702" } 25chalk-rust-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "ea1725e6bcf1881ad6c8304941e2282f33d32d1d" }
26chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "2939913fb7bb94ac2a6721087dc086be11410702" } 26chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev = "ea1725e6bcf1881ad6c8304941e2282f33d32d1d" }
27 27
28lalrpop-intern = "0.15.1" 28lalrpop-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>;
121pub type StructDatum = chalk_rust_ir::StructDatum<Interner>; 122pub type StructDatum = chalk_rust_ir::StructDatum<Interner>;
122pub type ImplId = chalk_ir::ImplId<Interner>; 123pub type ImplId = chalk_ir::ImplId<Interner>;
123pub type ImplDatum = chalk_rust_ir::ImplDatum<Interner>; 124pub type ImplDatum = chalk_rust_ir::ImplDatum<Interner>;
124pub type AssociatedTyValueId = chalk_rust_ir::AssociatedTyValueId; 125pub type AssociatedTyValueId = chalk_rust_ir::AssociatedTyValueId<Interner>;
125pub type AssociatedTyValue = chalk_rust_ir::AssociatedTyValue<Interner>; 126pub type AssociatedTyValue = chalk_rust_ir::AssociatedTyValue<Interner>;
126 127
127pub(super) trait ToChalk { 128pub(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
825fn id_from_chalk<T: InternKey>(chalk_id: chalk_ir::RawId) -> T {
826 T::from_intern_id(InternId::from(chalk_id.index))
827}
828fn 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
832impl From<StructId> for crate::TypeCtorId { 826impl 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
856impl From<chalk_rust_ir::AssociatedTyValueId> for crate::traits::AssocTyValueId { 850impl 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
862impl From<crate::traits::AssocTyValueId> for chalk_rust_ir::AssociatedTyValueId { 856impl 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}