aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-25 15:44:36 +0000
committerAleksey Kladov <[email protected]>2019-11-25 15:44:36 +0000
commit6d2ec8765d418b365dfaf472ab9b2b53b8eeafa9 (patch)
tree90d744b6d80d779b60e081b02c9960ec41791705 /crates/ra_hir/src/ty
parent3e32ac4f866e2b9430dd1e91b2c7fa3824c646a9 (diff)
Use TypeAliasId in Ty, pt 1
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/traits/chalk.rs14
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};
10use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum}; 10use chalk_rust_ir::{AssociatedTyDatum, AssociatedTyValue, ImplDatum, StructDatum, TraitDatum};
11 11
12use hir_def::{lang_item::LangItemTarget, GenericDefId}; 12use hir_def::{lang_item::LangItemTarget, GenericDefId, TypeAliasId};
13use hir_expand::name; 13use hir_expand::name;
14 14
15use ra_db::salsa::{InternId, InternKey}; 15use ra_db::salsa::{InternId, InternKey};
@@ -215,6 +215,18 @@ impl ToChalk for TypeAlias {
215 } 215 }
216} 216}
217 217
218impl 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
218impl ToChalk for AssocTyValue { 230impl ToChalk for AssocTyValue {
219 type Chalk = chalk_rust_ir::AssociatedTyValueId; 231 type Chalk = chalk_rust_ir::AssociatedTyValueId;
220 232