aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs18
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 452b357e8..5e4f97a46 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -10,11 +10,9 @@ use base_db::salsa::InternKey;
10use hir_def::{GenericDefId, TypeAliasId}; 10use hir_def::{GenericDefId, TypeAliasId};
11 11
12use crate::{ 12use crate::{
13 db::HirDatabase, 13 db::HirDatabase, primitive::UintTy, AliasTy, CallableDefId, Canonical, DomainGoal, FnPointer,
14 primitive::UintTy, 14 GenericArg, InEnvironment, OpaqueTy, ProjectionTy, QuantifiedWhereClause, Scalar, Substitution,
15 traits::{Canonical, DomainGoal}, 15 TraitRef, Ty, TypeWalk, WhereClause,
16 AliasTy, CallableDefId, FnPointer, GenericArg, InEnvironment, OpaqueTy, ProjectionTy,
17 QuantifiedWhereClause, Scalar, Substitution, TraitRef, Ty, TypeWalk, WhereClause,
18}; 16};
19 17
20use super::interner::*; 18use super::interner::*;
@@ -220,8 +218,8 @@ impl ToChalk for GenericArg {
220 type Chalk = chalk_ir::GenericArg<Interner>; 218 type Chalk = chalk_ir::GenericArg<Interner>;
221 219
222 fn to_chalk(self, db: &dyn HirDatabase) -> Self::Chalk { 220 fn to_chalk(self, db: &dyn HirDatabase) -> Self::Chalk {
223 match self.interned { 221 match self.interned() {
224 crate::GenericArgData::Ty(ty) => ty.to_chalk(db).cast(&Interner), 222 crate::GenericArgData::Ty(ty) => ty.clone().to_chalk(db).cast(&Interner),
225 } 223 }
226 } 224 }
227 225
@@ -249,7 +247,7 @@ impl ToChalk for Substitution {
249 parameters: chalk_ir::Substitution<Interner>, 247 parameters: chalk_ir::Substitution<Interner>,
250 ) -> Substitution { 248 ) -> Substitution {
251 let tys = parameters.iter(&Interner).map(|p| from_chalk(db, p.clone())).collect(); 249 let tys = parameters.iter(&Interner).map(|p| from_chalk(db, p.clone())).collect();
252 Substitution(tys) 250 Substitution::intern(tys)
253 } 251 }
254} 252}
255 253
@@ -546,7 +544,7 @@ pub(super) fn generic_predicate_to_inline_bound(
546 // have the expected self type 544 // have the expected self type
547 return None; 545 return None;
548 } 546 }
549 let args_no_self = trait_ref.substitution.interned(&Interner)[1..] 547 let args_no_self = trait_ref.substitution.interned()[1..]
550 .iter() 548 .iter()
551 .map(|ty| ty.clone().to_chalk(db).cast(&Interner)) 549 .map(|ty| ty.clone().to_chalk(db).cast(&Interner))
552 .collect(); 550 .collect();
@@ -558,7 +556,7 @@ pub(super) fn generic_predicate_to_inline_bound(
558 return None; 556 return None;
559 } 557 }
560 let trait_ = projection_ty.trait_(db); 558 let trait_ = projection_ty.trait_(db);
561 let args_no_self = projection_ty.substitution.interned(&Interner)[1..] 559 let args_no_self = projection_ty.substitution.interned()[1..]
562 .iter() 560 .iter()
563 .map(|ty| ty.clone().to_chalk(db).cast(&Interner)) 561 .map(|ty| ty.clone().to_chalk(db).cast(&Interner))
564 .collect(); 562 .collect();