From 9da191c7e07abec9d9f056fd94ee151aef7417a7 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 5 Apr 2021 22:12:40 +0200 Subject: Add Lifetime to DynTy --- crates/hir_ty/src/lower.rs | 4 +++- crates/hir_ty/src/traits/chalk/mapping.rs | 1 + crates/hir_ty/src/types.rs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) 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> { ) }); let bounds = crate::make_only_type_binders(1, bounds); - TyKind::Dyn(DynTy { bounds }).intern(&Interner) + TyKind::Dyn(DynTy { bounds, lifetime: LifetimeData::Static.intern(&Interner) }) + .intern(&Interner) } TypeRef::ImplTrait(bounds) => { match self.impl_trait_mode { @@ -392,6 +393,7 @@ impl<'a> TyLoweringContext<'a> { ))), ), ), + lifetime: LifetimeData::Static.intern(&Interner), }; TyKind::Dyn(dyn_ty).intern(&Interner) }; 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 { where_clauses.bounds.binders.clone(), crate::QuantifiedWhereClauses::from_iter(&Interner, bounds), ), + lifetime: LifetimeData::Static.intern(&Interner), }) } 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 { pub struct DynTy { /// The unknown self type. pub bounds: Binders, + pub lifetime: Lifetime, } #[derive(Clone, PartialEq, Eq, Debug, Hash)] -- cgit v1.2.3