aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-04-05 21:08:16 +0100
committerLukas Wirth <[email protected]>2021-04-06 09:45:30 +0100
commit96756f1b1df4729fd00ca96a59971b3997c91934 (patch)
tree1daa47d67081772ed1a61b0db13ff041337ddf8b /crates/hir_ty/src/traits
parent4bc8a018302d53951ae855ba57d07095a16ef182 (diff)
Add Lifetime to TyKind::Ref
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 3047fbacb..26f8fdbdc 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -11,7 +11,7 @@ use hir_def::{GenericDefId, TypeAliasId};
11 11
12use crate::{ 12use crate::{
13 chalk_ext::ProjectionTyExt, db::HirDatabase, primitive::UintTy, AliasTy, CallableDefId, 13 chalk_ext::ProjectionTyExt, db::HirDatabase, primitive::UintTy, AliasTy, CallableDefId,
14 Canonical, DomainGoal, FnPointer, GenericArg, InEnvironment, OpaqueTy, ProjectionTy, 14 Canonical, DomainGoal, FnPointer, GenericArg, InEnvironment, Lifetime, OpaqueTy, ProjectionTy,
15 QuantifiedWhereClause, Scalar, Substitution, TraitRef, Ty, TypeWalk, WhereClause, 15 QuantifiedWhereClause, Scalar, Substitution, TraitRef, Ty, TypeWalk, WhereClause,
16}; 16};
17 17
@@ -22,7 +22,7 @@ impl ToChalk for Ty {
22 type Chalk = chalk_ir::Ty<Interner>; 22 type Chalk = chalk_ir::Ty<Interner>;
23 fn to_chalk(self, db: &dyn HirDatabase) -> chalk_ir::Ty<Interner> { 23 fn to_chalk(self, db: &dyn HirDatabase) -> chalk_ir::Ty<Interner> {
24 match self.into_inner() { 24 match self.into_inner() {
25 TyKind::Ref(m, ty) => ref_to_chalk(db, m, ty), 25 TyKind::Ref(m, lt, ty) => ref_to_chalk(db, m, lt, ty),
26 TyKind::Array(ty) => array_to_chalk(db, ty), 26 TyKind::Array(ty) => array_to_chalk(db, ty),
27 TyKind::Function(FnPointer { sig, substitution: substs, .. }) => { 27 TyKind::Function(FnPointer { sig, substitution: substs, .. }) => {
28 let substitution = chalk_ir::FnSubst(substs.0.to_chalk(db)); 28 let substitution = chalk_ir::FnSubst(substs.0.to_chalk(db));
@@ -167,8 +167,8 @@ impl ToChalk for Ty {
167 } 167 }
168 chalk_ir::TyKind::Raw(mutability, ty) => TyKind::Raw(mutability, from_chalk(db, ty)), 168 chalk_ir::TyKind::Raw(mutability, ty) => TyKind::Raw(mutability, from_chalk(db, ty)),
169 chalk_ir::TyKind::Slice(ty) => TyKind::Slice(from_chalk(db, ty)), 169 chalk_ir::TyKind::Slice(ty) => TyKind::Slice(from_chalk(db, ty)),
170 chalk_ir::TyKind::Ref(mutability, _lifetime, ty) => { 170 chalk_ir::TyKind::Ref(mutability, lifetime, ty) => {
171 TyKind::Ref(mutability, from_chalk(db, ty)) 171 TyKind::Ref(mutability, lifetime, from_chalk(db, ty))
172 } 172 }
173 chalk_ir::TyKind::Str => TyKind::Str, 173 chalk_ir::TyKind::Str => TyKind::Str,
174 chalk_ir::TyKind::Never => TyKind::Never, 174 chalk_ir::TyKind::Never => TyKind::Never,
@@ -192,10 +192,10 @@ impl ToChalk for Ty {
192fn ref_to_chalk( 192fn ref_to_chalk(
193 db: &dyn HirDatabase, 193 db: &dyn HirDatabase,
194 mutability: chalk_ir::Mutability, 194 mutability: chalk_ir::Mutability,
195 lifetime: Lifetime,
195 ty: Ty, 196 ty: Ty,
196) -> chalk_ir::Ty<Interner> { 197) -> chalk_ir::Ty<Interner> {
197 let arg = ty.to_chalk(db); 198 let arg = ty.to_chalk(db);
198 let lifetime = LifetimeData::Static.intern(&Interner);
199 chalk_ir::TyKind::Ref(mutability, lifetime, arg).intern(&Interner) 199 chalk_ir::TyKind::Ref(mutability, lifetime, arg).intern(&Interner)
200} 200}
201 201