Add Lifetime to DynTy

This commit is contained in:
Lukas Wirth 2021-04-05 22:12:40 +02:00
parent 96756f1b1d
commit 9da191c7e0
3 changed files with 5 additions and 1 deletions

View File

@ -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)
};

View File

@ -149,6 +149,7 @@ impl ToChalk for Ty {
where_clauses.bounds.binders.clone(),
crate::QuantifiedWhereClauses::from_iter(&Interner, bounds),
),
lifetime: LifetimeData::Static.intern(&Interner),
})
}

View File

@ -40,6 +40,7 @@ impl ProjectionTy {
pub struct DynTy {
/// The unknown self type.
pub bounds: Binders<QuantifiedWhereClauses>,
pub lifetime: Lifetime,
}
#[derive(Clone, PartialEq, Eq, Debug, Hash)]