diff options
author | Aleksey Kladov <[email protected]> | 2019-11-25 15:44:36 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-11-25 15:44:36 +0000 |
commit | 6d2ec8765d418b365dfaf472ab9b2b53b8eeafa9 (patch) | |
tree | 90d744b6d80d779b60e081b02c9960ec41791705 /crates/ra_hir/src/ty/traits | |
parent | 3e32ac4f866e2b9430dd1e91b2c7fa3824c646a9 (diff) |
Use TypeAliasId in Ty, pt 1
Diffstat (limited to 'crates/ra_hir/src/ty/traits')
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 0272dd9ae..fd2f1b174 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs | |||
@@ -9,7 +9,7 @@ use chalk_ir::{ | |||
9 | }; | 9 | }; |
10 | use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum}; | 10 | use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum}; |
11 | 11 | ||
12 | use hir_def::{lang_item::LangItemTarget, GenericDefId}; | 12 | use hir_def::{lang_item::LangItemTarget, GenericDefId, TypeAliasId}; |
13 | use hir_expand::name; | 13 | use hir_expand::name; |
14 | 14 | ||
15 | use ra_db::salsa::{InternId, InternKey}; | 15 | use ra_db::salsa::{InternId, InternKey}; |
@@ -215,6 +215,18 @@ impl ToChalk for TypeAlias { | |||
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | impl ToChalk for TypeAliasId { | ||
219 | type Chalk = chalk_ir::TypeId; | ||
220 | |||
221 | fn to_chalk(self, _db: &impl HirDatabase) -> chalk_ir::TypeId { | ||
222 | chalk_ir::TypeId(id_to_chalk(self)) | ||
223 | } | ||
224 | |||
225 | fn from_chalk(_db: &impl HirDatabase, type_alias_id: chalk_ir::TypeId) -> TypeAliasId { | ||
226 | id_from_chalk(type_alias_id.0) | ||
227 | } | ||
228 | } | ||
229 | |||
218 | impl ToChalk for AssocTyValue { | 230 | impl ToChalk for AssocTyValue { |
219 | type Chalk = chalk_rust_ir::AssociatedTyValueId; | 231 | type Chalk = chalk_rust_ir::AssociatedTyValueId; |
220 | 232 | ||