1
Fork 0

rustc_target: require TyAbiInterface in LayoutOf.

This commit is contained in:
Eduard-Mihai Burtescu 2021-08-25 16:40:39 +03:00
parent 8486571a10
commit 87d1fb747f
4 changed files with 47 additions and 5 deletions

View file

@ -1174,8 +1174,8 @@ impl<'a, Ty> Deref for TyAndLayout<'a, Ty> {
}
/// Trait for context types that can compute layouts of things.
pub trait LayoutOf<'a> {
type Ty;
pub trait LayoutOf<'a>: Sized {
type Ty: TyAbiInterface<'a, Self>;
type TyAndLayout: MaybeResult<TyAndLayout<'a, Self::Ty>>;
fn layout_of(&self, ty: Self::Ty) -> Self::TyAndLayout;