Skip to content

Commit 9da191c

Browse files
committed
Add Lifetime to DynTy
1 parent 96756f1 commit 9da191c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

crates/hir_ty/src/lower.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ impl<'a> TyLoweringContext<'a> {
200200
)
201201
});
202202
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)
204205
}
205206
TypeRef::ImplTrait(bounds) => {
206207
match self.impl_trait_mode {
@@ -392,6 +393,7 @@ impl<'a> TyLoweringContext<'a> {
392393
))),
393394
),
394395
),
396+
lifetime: LifetimeData::Static.intern(&Interner),
395397
};
396398
TyKind::Dyn(dyn_ty).intern(&Interner)
397399
};

crates/hir_ty/src/traits/chalk/mapping.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ impl ToChalk for Ty {
149149
where_clauses.bounds.binders.clone(),
150150
crate::QuantifiedWhereClauses::from_iter(&Interner, bounds),
151151
),
152+
lifetime: LifetimeData::Static.intern(&Interner),
152153
})
153154
}
154155

crates/hir_ty/src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl ProjectionTy {
4040
pub struct DynTy {
4141
/// The unknown self type.
4242
pub bounds: Binders<QuantifiedWhereClauses>,
43+
pub lifetime: Lifetime,
4344
}
4445

4546
#[derive(Clone, PartialEq, Eq, Debug, Hash)]

0 commit comments

Comments
 (0)