aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-04-05 21:12:40 +0100
committerLukas Wirth <[email protected]>2021-04-06 09:45:34 +0100
commit9da191c7e07abec9d9f056fd94ee151aef7417a7 (patch)
tree93b129a12ebb0c6f9890787d4bfda1e7d325bf68
parent96756f1b1df4729fd00ca96a59971b3997c91934 (diff)
Add Lifetime to DynTy
-rw-r--r--crates/hir_ty/src/lower.rs4
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs1
-rw-r--r--crates/hir_ty/src/types.rs1
3 files changed, 5 insertions, 1 deletions
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs
index 5a769fa6a..ff795377a 100644
--- a/crates/hir_ty/src/lower.rs
+++ b/crates/hir_ty/src/lower.rs
@@ -200,7 +200,8 @@ impl<'a> TyLoweringContext<'a> {
200 ) 200 )
201 }); 201 });
202 let bounds = crate::make_only_type_binders(1, bounds); 202 let bounds = crate::make_only_type_binders(1, bounds);
203 TyKind::Dyn(DynTy { bounds }).intern(&Interner) 203 TyKind::Dyn(DynTy { bounds, lifetime: LifetimeData::Static.intern(&Interner) })
204 .intern(&Interner)
204 } 205 }
205 TypeRef::ImplTrait(bounds) => { 206 TypeRef::ImplTrait(bounds) => {
206 match self.impl_trait_mode { 207 match self.impl_trait_mode {
@@ -392,6 +393,7 @@ impl<'a> TyLoweringContext<'a> {
392 ))), 393 ))),
393 ), 394 ),
394 ), 395 ),
396 lifetime: LifetimeData::Static.intern(&Interner),
395 }; 397 };
396 TyKind::Dyn(dyn_ty).intern(&Interner) 398 TyKind::Dyn(dyn_ty).intern(&Interner)
397 }; 399 };
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 26f8fdbdc..791f342a1 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -149,6 +149,7 @@ impl ToChalk for Ty {
149 where_clauses.bounds.binders.clone(), 149 where_clauses.bounds.binders.clone(),
150 crate::QuantifiedWhereClauses::from_iter(&Interner, bounds), 150 crate::QuantifiedWhereClauses::from_iter(&Interner, bounds),
151 ), 151 ),
152 lifetime: LifetimeData::Static.intern(&Interner),
152 }) 153 })
153 } 154 }
154 155
diff --git a/crates/hir_ty/src/types.rs b/crates/hir_ty/src/types.rs
index c984a31c8..844e57896 100644
--- a/crates/hir_ty/src/types.rs
+++ b/crates/hir_ty/src/types.rs
@@ -40,6 +40,7 @@ impl ProjectionTy {
40pub struct DynTy { 40pub struct DynTy {
41 /// The unknown self type. 41 /// The unknown self type.
42 pub bounds: Binders<QuantifiedWhereClauses>, 42 pub bounds: Binders<QuantifiedWhereClauses>,
43 pub lifetime: Lifetime,
43} 44}
44 45
45#[derive(Clone, PartialEq, Eq, Debug, Hash)] 46#[derive(Clone, PartialEq, Eq, Debug, Hash)]