diff options
Diffstat (limited to 'crates/ra_hir/src/ty/traits/chalk.rs')
-rw-r--r-- | crates/ra_hir/src/ty/traits/chalk.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/traits/chalk.rs b/crates/ra_hir/src/ty/traits/chalk.rs index 9e7ae0724..21055dcfd 100644 --- a/crates/ra_hir/src/ty/traits/chalk.rs +++ b/crates/ra_hir/src/ty/traits/chalk.rs | |||
@@ -50,6 +50,19 @@ impl ToChalk for Ty { | |||
50 | let parameters = apply_ty.parameters.to_chalk(db); | 50 | let parameters = apply_ty.parameters.to_chalk(db); |
51 | chalk_ir::ApplicationTy { name, parameters }.cast() | 51 | chalk_ir::ApplicationTy { name, parameters }.cast() |
52 | } | 52 | } |
53 | Ty::Projection(proj_ty) => { | ||
54 | let associated_ty_id = proj_ty.associated_ty.to_chalk(db); | ||
55 | let parameters = proj_ty.parameters.to_chalk(db); | ||
56 | chalk_ir::ProjectionTy { associated_ty_id, parameters }.cast() | ||
57 | } | ||
58 | Ty::UnselectedProjection(proj_ty) => { | ||
59 | let type_name = lalrpop_intern::intern(&proj_ty.type_name.to_string()); | ||
60 | let parameters = proj_ty.parameters.to_chalk(db); | ||
61 | chalk_ir::Ty::UnselectedProjection(chalk_ir::UnselectedProjectionTy { | ||
62 | type_name, | ||
63 | parameters, | ||
64 | }) | ||
65 | } | ||
53 | Ty::Param { idx, .. } => { | 66 | Ty::Param { idx, .. } => { |
54 | PlaceholderIndex { ui: UniverseIndex::ROOT, idx: idx as usize }.to_ty() | 67 | PlaceholderIndex { ui: UniverseIndex::ROOT, idx: idx as usize }.to_ty() |
55 | } | 68 | } |
@@ -529,6 +542,16 @@ pub(crate) fn struct_datum_query( | |||
529 | adt.krate(db) != Some(krate), | 542 | adt.krate(db) != Some(krate), |
530 | ) | 543 | ) |
531 | } | 544 | } |
545 | TypeCtor::AssociatedType(type_alias) => { | ||
546 | let generic_params = type_alias.generic_params(db); | ||
547 | let bound_vars = Substs::bound_vars(&generic_params); | ||
548 | let where_clauses = convert_where_clauses(db, type_alias.into(), &bound_vars); | ||
549 | ( | ||
550 | generic_params.count_params_including_parent(), | ||
551 | where_clauses, | ||
552 | type_alias.krate(db) != Some(krate), | ||
553 | ) | ||
554 | } | ||
532 | }; | 555 | }; |
533 | let flags = chalk_rust_ir::StructFlags { | 556 | let flags = chalk_rust_ir::StructFlags { |
534 | upstream, | 557 | upstream, |