Skip to content

Instantly share code, notes, and snippets.

@Ameobea
Created October 6, 2020 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ameobea/ed01812726b2a20f818194da4d1134dc to your computer and use it in GitHub Desktop.
Save Ameobea/ed01812726b2a20f818194da4d1134dc to your computer and use it in GitHub Desktop.
fix for chalk unimplemented panics in rust analyzer
diff --git a/Cargo.lock b/Cargo.lock
index 49022502d..9c921902c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -162,9 +162,8 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "chalk-derive"
-version = "0.30.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6696d18587b7470c1e357a3fa120a2b7e6ac95e91d5c408f087455f7dc31f8b"
+version = "0.32.0-dev.0"
+source = "git+https://github.com/rust-lang/chalk.git?rev=ebe62c2bc46899a0a92eabb456b38ad2d40abbd0#ebe62c2bc46899a0a92eabb456b38ad2d40abbd0"
dependencies = [
"proc-macro2",
"quote",
@@ -174,9 +173,8 @@ dependencies = [
[[package]]
name = "chalk-ir"
-version = "0.30.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c9538918d3e1fd6edda042d717c969a4099af67a40372dfb0a00b45d3a5a946"
+version = "0.32.0-dev.0"
+source = "git+https://github.com/rust-lang/chalk.git?rev=ebe62c2bc46899a0a92eabb456b38ad2d40abbd0#ebe62c2bc46899a0a92eabb456b38ad2d40abbd0"
dependencies = [
"chalk-derive",
"lazy_static",
@@ -184,9 +182,8 @@ dependencies = [
[[package]]
name = "chalk-recursive"
-version = "0.30.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97ec8d95c808f2b540c39da889536e1ae0d15182107f61fe80000ec3a5c3959a"
+version = "0.32.0-dev.0"
+source = "git+https://github.com/rust-lang/chalk.git?rev=ebe62c2bc46899a0a92eabb456b38ad2d40abbd0#ebe62c2bc46899a0a92eabb456b38ad2d40abbd0"
dependencies = [
"chalk-derive",
"chalk-ir",
@@ -197,9 +194,8 @@ dependencies = [
[[package]]
name = "chalk-solve"
-version = "0.30.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f373dff4bcff66004424b72bcc56ae62889c21887c1cac875f083f69a7da4448"
+version = "0.32.0-dev.0"
+source = "git+https://github.com/rust-lang/chalk.git?rev=ebe62c2bc46899a0a92eabb456b38ad2d40abbd0#ebe62c2bc46899a0a92eabb456b38ad2d40abbd0"
dependencies = [
"chalk-derive",
"chalk-ir",
diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml
index ed1c911c2..15c536c89 100644
--- a/crates/hir_ty/Cargo.toml
+++ b/crates/hir_ty/Cargo.toml
@@ -17,9 +17,9 @@ ena = "0.14.0"
log = "0.4.8"
rustc-hash = "1.1.0"
scoped-tls = "1"
-chalk-solve = { version = "0.30.0" }
-chalk-ir = { version = "0.30.0" }
-chalk-recursive = { version = "0.30.0" }
+chalk-solve = { git = "https://github.com/rust-lang/chalk.git", rev="ebe62c2bc46899a0a92eabb456b38ad2d40abbd0" }
+chalk-ir = { git = "https://github.com/rust-lang/chalk.git", rev="ebe62c2bc46899a0a92eabb456b38ad2d40abbd0" }
+chalk-recursive = { git = "https://github.com/rust-lang/chalk.git", rev="ebe62c2bc46899a0a92eabb456b38ad2d40abbd0" }
stdx = { path = "../stdx", version = "0.0.0" }
hir_def = { path = "../hir_def", version = "0.0.0" }
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs
index 009b17a7f..980218162 100644
--- a/crates/hir_ty/src/traits/chalk.rs
+++ b/crates/hir_ty/src/traits/chalk.rs
@@ -330,6 +330,18 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
fn fn_def_name(&self, fn_def_id: chalk_ir::FnDefId<Interner>) -> String {
format!("fn_{}", fn_def_id.0)
}
+ fn generator_datum(
+ &self,
+ _: chalk_ir::GeneratorId<Interner>,
+ ) -> std::sync::Arc<chalk_solve::rust_ir::GeneratorDatum<Interner>> {
+ todo!()
+ }
+ fn generator_witness_datum(
+ &self,
+ _: chalk_ir::GeneratorId<Interner>,
+ ) -> std::sync::Arc<chalk_solve::rust_ir::GeneratorWitnessDatum<Interner>> {
+ todo!()
+ }
}
pub(crate) fn program_clauses_for_chalk_env_query(
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index d42f4bba9..140b20213 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -399,6 +399,7 @@ impl ToChalk for TypeCtor {
// this should not be reached, since we don't represent TypeName::Error with TypeCtor
unreachable!()
}
+ _ => todo!(),
}
}
}
diff --git a/editors/code/package.json b/editors/code/package.json
index 1f0e7550b..6a712a8a8 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -1048,4 +1048,4 @@
]
}
}
-}
\ No newline at end of file
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment