Skip to content

Commit 1c199f6

Browse files
half work: upgrade chalk
1 parent ee2d5fa commit 1c199f6

File tree

3 files changed

+32
-21
lines changed

3 files changed

+32
-21
lines changed

Cargo.lock

+5-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+8-8
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ debug = 2
3535
[patch.'crates-io']
3636
# rowan = { path = "../rowan" }
3737

38-
# chalk-solve = { path = "../chalk/chalk-solve" }
39-
# chalk-ir = { path = "../chalk/chalk-ir" }
40-
# chalk-recursive = { path = "../chalk/chalk-recursive" }
41-
# chalk-derive = { path = "../chalk/chalk-derive" }
38+
chalk-solve = { path = "../chalk/chalk-solve" }
39+
chalk-ir = { path = "../chalk/chalk-ir" }
40+
chalk-recursive = { path = "../chalk/chalk-recursive" }
41+
chalk-derive = { path = "../chalk/chalk-derive" }
4242
# line-index = { path = "lib/line-index" }
4343
# la-arena = { path = "lib/la-arena" }
4444
# lsp-server = { path = "lib/lsp-server" }
@@ -105,10 +105,10 @@ arrayvec = "0.7.4"
105105
bitflags = "2.4.1"
106106
cargo_metadata = "0.18.1"
107107
camino = "1.1.6"
108-
chalk-solve = { version = "0.100.0", default-features = false }
109-
chalk-ir = "0.100.0"
110-
chalk-recursive = { version = "0.100.0", default-features = false }
111-
chalk-derive = "0.100.0"
108+
chalk-solve = { version = "0.101.0-dev.0", default-features = false }
109+
chalk-ir = "0.101.0-dev.0"
110+
chalk-recursive = { version = "0.101.0-dev.0", default-features = false }
111+
chalk-derive = "0.101.0-dev.0"
112112
crossbeam-channel = "0.5.8"
113113
dissimilar = "1.0.7"
114114
dot = "0.1.4"

crates/hir-ty/src/chalk_db.rs

+19
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,25 @@ pub(crate) type FnDefDatum = chalk_solve::rust_ir::FnDefDatum<Interner>;
6666
pub(crate) type Variances = chalk_ir::Variances<Interner>;
6767

6868
impl chalk_solve::RustIrDatabase<Interner> for ChalkContext<'_> {
69+
fn associated_ty_matches(
70+
&self,
71+
trait_item: AssocTypeId,
72+
impl_item: AssociatedTyValueId,
73+
) -> bool {
74+
let trait_item = from_assoc_type_id(self.db, trait_item);
75+
let impl_item = from_assoc_type_value_id(self.db, impl_item);
76+
match (trait_item, impl_item) {
77+
(AnyTraitAssocType::Normal(impl_item), AnyImplAssocType::Normal(trait_item)) => {
78+
let trait_assoc = self.db.type_alias_data(trait_item);
79+
let impl_assoc = self.db.type_alias_data(impl_item);
80+
trait_assoc.name == impl_assoc.name
81+
}
82+
(AnyTraitAssocType::Rpitit(trait_item), AnyImplAssocType::Rpitit(impl_item)) => {
83+
impl_item.loc(self.db).trait_assoc == trait_item
84+
}
85+
_ => false,
86+
}
87+
}
6988
fn associated_ty_data(&self, id: AssocTypeId) -> Arc<AssociatedTyDatum> {
7089
self.db.associated_ty_data(id)
7190
}

0 commit comments

Comments
 (0)