Move SIMD layout logic to rustc_abi

This commit is contained in:
Moulins
2025-03-07 21:17:16 +01:00
parent 9917173575
commit e69491ac60
5 changed files with 117 additions and 79 deletions

View File

@@ -150,6 +150,12 @@ impl<'a, Ty> Deref for TyAndLayout<'a, Ty> {
}
}
impl<'a, Ty> AsRef<LayoutData<FieldIdx, VariantIdx>> for TyAndLayout<'a, Ty> {
fn as_ref(&self) -> &LayoutData<FieldIdx, VariantIdx> {
&*self.layout.0.0
}
}
/// Trait that needs to be implemented by the higher-level type representation
/// (e.g. `rustc_middle::ty::Ty`), to provide `rustc_target::abi` functionality.
pub trait TyAbiInterface<'a, C>: Sized + std::fmt::Debug {