aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits/chalk
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-03-14 15:26:12 +0000
committerFlorian Diebold <[email protected]>2021-03-14 15:30:43 +0000
commit3411fe3e84e641aad03abbc22eec33fdc29b15f8 (patch)
treef9590b609da68c1d466381b8de809f60511dd628 /crates/hir_ty/src/traits/chalk
parentf57e2f55984758a83644b852a4cc47e0b27945df (diff)
Rename some fields to their Chalk names
Diffstat (limited to 'crates/hir_ty/src/traits/chalk')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 2a66a2310..68effbbf3 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -78,8 +78,8 @@ impl ToChalk for Ty {
78 chalk_ir::TyKind::Adt(adt_id, substitution).intern(&Interner) 78 chalk_ir::TyKind::Adt(adt_id, substitution).intern(&Interner)
79 } 79 }
80 TyKind::Alias(AliasTy::Projection(proj_ty)) => { 80 TyKind::Alias(AliasTy::Projection(proj_ty)) => {
81 let associated_ty_id = proj_ty.associated_ty; 81 let associated_ty_id = proj_ty.associated_ty_id;
82 let substitution = proj_ty.parameters.to_chalk(db); 82 let substitution = proj_ty.substitution.to_chalk(db);
83 chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy { 83 chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
84 associated_ty_id, 84 associated_ty_id,
85 substitution, 85 substitution,
@@ -121,7 +121,7 @@ impl ToChalk for Ty {
121 chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(proj)) => { 121 chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(proj)) => {
122 let associated_ty = proj.associated_ty_id; 122 let associated_ty = proj.associated_ty_id;
123 let parameters = from_chalk(db, proj.substitution); 123 let parameters = from_chalk(db, proj.substitution);
124 TyKind::Alias(AliasTy::Projection(ProjectionTy { associated_ty, parameters })) 124 TyKind::Alias(AliasTy::Projection(ProjectionTy { associated_ty_id: associated_ty, substitution: parameters }))
125 } 125 }
126 chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(opaque_ty)) => { 126 chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(opaque_ty)) => {
127 let opaque_ty_id = opaque_ty.opaque_ty_id; 127 let opaque_ty_id = opaque_ty.opaque_ty_id;
@@ -372,8 +372,8 @@ impl ToChalk for ProjectionTy {
372 372
373 fn to_chalk(self, db: &dyn HirDatabase) -> chalk_ir::ProjectionTy<Interner> { 373 fn to_chalk(self, db: &dyn HirDatabase) -> chalk_ir::ProjectionTy<Interner> {
374 chalk_ir::ProjectionTy { 374 chalk_ir::ProjectionTy {
375 associated_ty_id: self.associated_ty, 375 associated_ty_id: self.associated_ty_id,
376 substitution: self.parameters.to_chalk(db), 376 substitution: self.substitution.to_chalk(db),
377 } 377 }
378 } 378 }
379 379
@@ -382,8 +382,8 @@ impl ToChalk for ProjectionTy {
382 projection_ty: chalk_ir::ProjectionTy<Interner>, 382 projection_ty: chalk_ir::ProjectionTy<Interner>,
383 ) -> ProjectionTy { 383 ) -> ProjectionTy {
384 ProjectionTy { 384 ProjectionTy {
385 associated_ty: projection_ty.associated_ty_id, 385 associated_ty_id: projection_ty.associated_ty_id,
386 parameters: from_chalk(db, projection_ty.substitution), 386 substitution: from_chalk(db, projection_ty.substitution),
387 } 387 }
388 } 388 }
389} 389}
@@ -533,24 +533,24 @@ pub(super) fn generic_predicate_to_inline_bound(
533 Some(rust_ir::InlineBound::TraitBound(trait_bound)) 533 Some(rust_ir::InlineBound::TraitBound(trait_bound))
534 } 534 }
535 GenericPredicate::Projection(proj) => { 535 GenericPredicate::Projection(proj) => {
536 if &proj.projection_ty.parameters[0] != self_ty { 536 if &proj.projection_ty.substitution[0] != self_ty {
537 return None; 537 return None;
538 } 538 }
539 let trait_ = match from_assoc_type_id(proj.projection_ty.associated_ty) 539 let trait_ = match from_assoc_type_id(proj.projection_ty.associated_ty_id)
540 .lookup(db.upcast()) 540 .lookup(db.upcast())
541 .container 541 .container
542 { 542 {
543 AssocContainerId::TraitId(t) => t, 543 AssocContainerId::TraitId(t) => t,
544 _ => panic!("associated type not in trait"), 544 _ => panic!("associated type not in trait"),
545 }; 545 };
546 let args_no_self = proj.projection_ty.parameters[1..] 546 let args_no_self = proj.projection_ty.substitution[1..]
547 .iter() 547 .iter()
548 .map(|ty| ty.clone().to_chalk(db).cast(&Interner)) 548 .map(|ty| ty.clone().to_chalk(db).cast(&Interner))
549 .collect(); 549 .collect();
550 let alias_eq_bound = rust_ir::AliasEqBound { 550 let alias_eq_bound = rust_ir::AliasEqBound {
551 value: proj.ty.clone().to_chalk(db), 551 value: proj.ty.clone().to_chalk(db),
552 trait_bound: rust_ir::TraitBound { trait_id: trait_.to_chalk(db), args_no_self }, 552 trait_bound: rust_ir::TraitBound { trait_id: trait_.to_chalk(db), args_no_self },
553 associated_ty_id: proj.projection_ty.associated_ty, 553 associated_ty_id: proj.projection_ty.associated_ty_id,
554 parameters: Vec::new(), // FIXME we don't support generic associated types yet 554 parameters: Vec::new(), // FIXME we don't support generic associated types yet
555 }; 555 };
556 Some(rust_ir::InlineBound::AliasEqBound(alias_eq_bound)) 556 Some(rust_ir::InlineBound::AliasEqBound(alias_eq_bound))