From 7310f3f801a8dff37503dd4ed3e3e2ecbf6bac2e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 1 May 2019 20:50:11 +0200 Subject: Handle Ty::Unknown in Chalk conversion Badly, but at least it doesn't crash. --- crates/ra_hir/src/ty/traits/chalk.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 18f301789..02df5a4fa 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs @@ -36,7 +36,11 @@ impl ToChalk for Ty { } Ty::Bound(idx) => chalk_ir::Ty::BoundVar(idx as usize), Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), - Ty::Unknown => unimplemented!(), // TODO turn into placeholder? + // FIXME this is clearly incorrect, but probably not too incorrect + // and I'm not sure what to actually do with Ty::Unknown + Ty::Unknown => { + PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty() + }, } } fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self { -- cgit v1.2.3