From 56a8a7645f9d6c872e9598b5a2617805f387e2a6 Mon Sep 17 00:00:00 2001 From: Casey Primozic Date: Tue, 6 Oct 2020 15:05:20 -0700 Subject: Bump chalk to use latest git to get fix * Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking. This allows it to be usable again for code that hits those situations. See #6134, #6145, Probably #6120 --- crates/hir_ty/Cargo.toml | 6 +++--- crates/hir_ty/src/traits/chalk.rs | 12 ++++++++++++ crates/hir_ty/src/traits/chalk/mapping.rs | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'crates') 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 for ChalkContext<'a> { fn fn_def_name(&self, fn_def_id: chalk_ir::FnDefId) -> String { format!("fn_{}", fn_def_id.0) } + fn generator_datum( + &self, + _: chalk_ir::GeneratorId, + ) -> std::sync::Arc> { + todo!() + } + fn generator_witness_datum( + &self, + _: chalk_ir::GeneratorId, + ) -> std::sync::Arc> { + 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!(), } } } -- cgit v1.2.3 From f40e86e1412206dd3b097ef9bd0c22fd1c358293 Mon Sep 17 00:00:00 2001 From: Casey Primozic Date: Tue, 6 Oct 2020 15:19:34 -0700 Subject: `todo!()` -> `unimplemented!() // FIXME` for CI --- crates/hir_ty/src/traits/chalk.rs | 6 ++++-- crates/hir_ty/src/traits/chalk/mapping.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 980218162..cbe5cd7dd 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs @@ -334,13 +334,15 @@ impl<'a> chalk_solve::RustIrDatabase for ChalkContext<'a> { &self, _: chalk_ir::GeneratorId, ) -> std::sync::Arc> { - todo!() + // FIXME + unimplemented!() } fn generator_witness_datum( &self, _: chalk_ir::GeneratorId, ) -> std::sync::Arc> { - todo!() + // FIXME + unimplemented!() } } diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 140b20213..31c902de6 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs @@ -399,7 +399,7 @@ impl ToChalk for TypeCtor { // this should not be reached, since we don't represent TypeName::Error with TypeCtor unreachable!() } - _ => todo!(), + _ => unimplemented!(), // FIXME } } } -- cgit v1.2.3 From 13bdadb515fa08a3a24362c92cfc658b8cf159de Mon Sep 17 00:00:00 2001 From: Casey Primozic Date: Tue, 6 Oct 2020 23:56:31 -0700 Subject: Make unimplemented match variants explicit --- crates/hir_ty/src/traits/chalk/mapping.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 31c902de6..be3301313 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs @@ -399,7 +399,8 @@ impl ToChalk for TypeCtor { // this should not be reached, since we don't represent TypeName::Error with TypeCtor unreachable!() } - _ => unimplemented!(), // FIXME + TypeName::Generator(_) => unimplemented!(), // FIXME + TypeName::GeneratorWitness(_) => unimplemented!(), // FIXME } } } -- cgit v1.2.3 From 37df2138ecb4a66aa8547467c7774dc9d378567b Mon Sep 17 00:00:00 2001 From: Casey Primozic Date: Wed, 7 Oct 2020 12:11:22 -0700 Subject: Switch from git to latest tagged release of chalk deps --- crates/hir_ty/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml index 15c536c89..0f3c85926 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 = { 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" } +chalk-solve = "0.32" +chalk-ir = "0.32" +chalk-recursive = "0.32" stdx = { path = "../stdx", version = "0.0.0" } hir_def = { path = "../hir_def", version = "0.0.0" } -- cgit v1.2.3