diff options
author | Florian Diebold <[email protected]> | 2019-05-01 19:50:11 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-05-04 17:18:30 +0100 |
commit | 7310f3f801a8dff37503dd4ed3e3e2ecbf6bac2e (patch) | |
tree | d0b0667cff1540bcec583e6a2b6362d8a2874295 /crates/ra_hir/src/ty | |
parent | 0ad7317b24dc90c3787482f9ec563e7830d499fc (diff) |
Handle Ty::Unknown in Chalk conversion
Badly, but at least it doesn't crash.
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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 { | |||
36 | } | 36 | } |
37 | Ty::Bound(idx) => chalk_ir::Ty::BoundVar(idx as usize), | 37 | Ty::Bound(idx) => chalk_ir::Ty::BoundVar(idx as usize), |
38 | Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), | 38 | Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), |
39 | Ty::Unknown => unimplemented!(), // TODO turn into placeholder? | 39 | // FIXME this is clearly incorrect, but probably not too incorrect |
40 | // and I'm not sure what to actually do with Ty::Unknown | ||
41 | Ty::Unknown => { | ||
42 | PlaceholderIndex { ui: UniverseIndex::ROOT, idx: 0 }.to_ty() | ||
43 | }, | ||
40 | } | 44 | } |
41 | } | 45 | } |
42 | fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self { | 46 | fn from_chalk(db: &impl HirDatabase, chalk: chalk_ir::Ty) -> Self { |