diff options
author | Florian Diebold <[email protected]> | 2019-11-15 20:00:27 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-11-16 12:11:29 +0000 |
commit | 9c2a9a9a0635e53466749fdedcdc5a371e658cde (patch) | |
tree | 904a60eca279975874c6c890109eb3c852347da0 /crates/ra_hir/src/ty/traits | |
parent | e21b82e035050570a8d8e77ebe8b50f7d34ad251 (diff) |
Use Chalk's dyn/impl trait support
Diffstat (limited to 'crates/ra_hir/src/ty/traits')
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index e39e8aaca..81a378bac 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs | |||
@@ -68,8 +68,15 @@ impl ToChalk for Ty { | |||
68 | } | 68 | } |
69 | Ty::Bound(idx) => chalk_ir::TyData::BoundVar(idx as usize).intern(), | 69 | Ty::Bound(idx) => chalk_ir::TyData::BoundVar(idx as usize).intern(), |
70 | Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), | 70 | Ty::Infer(_infer_ty) => panic!("uncanonicalized infer ty"), |
71 | // FIXME use Chalk's Dyn/Opaque once the bugs with that are fixed | 71 | Ty::Dyn(predicates) => { |
72 | Ty::Unknown | Ty::Dyn(_) | Ty::Opaque(_) => { | 72 | let where_clauses = predicates.iter().cloned().map(|p| p.to_chalk(db)).collect(); |
73 | chalk_ir::TyData::Dyn(make_binders(where_clauses, 1)).intern() | ||
74 | } | ||
75 | Ty::Opaque(predicates) => { | ||
76 | let where_clauses = predicates.iter().cloned().map(|p| p.to_chalk(db)).collect(); | ||
77 | chalk_ir::TyData::Opaque(make_binders(where_clauses, 1)).intern() | ||
78 | } | ||
79 | Ty::Unknown => { | ||
73 | let parameters = Vec::new(); | 80 | let parameters = Vec::new(); |
74 | let name = TypeName::Error; | 81 | let name = TypeName::Error; |
75 | chalk_ir::ApplicationTy { name, parameters }.cast().intern() | 82 | chalk_ir::ApplicationTy { name, parameters }.cast().intern() |