diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs index 5a769fa6ac25..ff795377a82c 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 26f8fdbdc323..791f342a14de 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 c984a31c851e..844e57896906 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)]