diff options
author | Florian Diebold <flodiebold@gmail.com> | 2021-03-14 15:33:27 +0000 |
---|---|---|
committer | Florian Diebold <flodiebold@gmail.com> | 2021-03-14 15:33:27 +0000 |
commit | 195414783402d6973f4e673e84be9b7bc19cbfa6 (patch) | |
tree | 79dcaa50fe38214d03c4e60b3738ca578e09d659 /crates/hir_ty/src/traits/chalk | |
parent | eea777c7148ac6c52434e8ea4913cdb50a466a3e (diff) |
More renaming
Diffstat (limited to 'crates/hir_ty/src/traits/chalk')
-rw-r--r-- | crates/hir_ty/src/traits/chalk/mapping.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 1a6fca611..05a4bf0df 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs | |||
@@ -87,6 +87,13 @@ impl ToChalk for Ty { | |||
87 | .cast(&Interner) | 87 | .cast(&Interner) |
88 | .intern(&Interner) | 88 | .intern(&Interner) |
89 | } | 89 | } |
90 | TyKind::Alias(AliasTy::Opaque(opaque_ty)) => { | ||
91 | let opaque_ty_id = opaque_ty.opaque_ty_id; | ||
92 | let substitution = opaque_ty.substitution.to_chalk(db); | ||
93 | chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy { opaque_ty_id, substitution }) | ||
94 | .cast(&Interner) | ||
95 | .intern(&Interner) | ||
96 | } | ||
90 | TyKind::Placeholder(idx) => idx.to_ty::<Interner>(&Interner), | 97 | TyKind::Placeholder(idx) => idx.to_ty::<Interner>(&Interner), |
91 | TyKind::BoundVar(idx) => chalk_ir::TyKind::BoundVar(idx).intern(&Interner), | 98 | TyKind::BoundVar(idx) => chalk_ir::TyKind::BoundVar(idx).intern(&Interner), |
92 | TyKind::InferenceVar(..) => panic!("uncanonicalized infer ty"), | 99 | TyKind::InferenceVar(..) => panic!("uncanonicalized infer ty"), |
@@ -101,15 +108,6 @@ impl ToChalk for Ty { | |||
101 | }; | 108 | }; |
102 | chalk_ir::TyKind::Dyn(bounded_ty).intern(&Interner) | 109 | chalk_ir::TyKind::Dyn(bounded_ty).intern(&Interner) |
103 | } | 110 | } |
104 | TyKind::Alias(AliasTy::Opaque(opaque_ty)) => { | ||
105 | let opaque_ty_id = opaque_ty.opaque_ty_id; | ||
106 | let substitution = opaque_ty.parameters.to_chalk(db); | ||
107 | chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy { | ||
108 | opaque_ty_id, | ||
109 | substitution, | ||
110 | })) | ||
111 | .intern(&Interner) | ||
112 | } | ||
113 | TyKind::Unknown => chalk_ir::TyKind::Error.intern(&Interner), | 111 | TyKind::Unknown => chalk_ir::TyKind::Error.intern(&Interner), |
114 | } | 112 | } |
115 | } | 113 | } |
@@ -129,7 +127,7 @@ impl ToChalk for Ty { | |||
129 | chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(opaque_ty)) => { | 127 | chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(opaque_ty)) => { |
130 | let opaque_ty_id = opaque_ty.opaque_ty_id; | 128 | let opaque_ty_id = opaque_ty.opaque_ty_id; |
131 | let parameters = from_chalk(db, opaque_ty.substitution); | 129 | let parameters = from_chalk(db, opaque_ty.substitution); |
132 | TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, parameters })) | 130 | TyKind::Alias(AliasTy::Opaque(OpaqueTy { opaque_ty_id, substitution: parameters })) |
133 | } | 131 | } |
134 | chalk_ir::TyKind::Function(chalk_ir::FnPointer { | 132 | chalk_ir::TyKind::Function(chalk_ir::FnPointer { |
135 | num_binders, | 133 | num_binders, |