1
Fork 0

Use associative type defaults in {Layout,FnAbi}OfHelpers.

This avoids some repetitive boilerplate code.
This commit is contained in:
Nicholas Nethercote 2024-09-16 19:58:37 +10:00
parent a8d22eb39e
commit acb832d640
8 changed files with 5 additions and 34 deletions

View file

@ -93,8 +93,6 @@ impl HasTargetSpec for Builder<'_, '_, '_> {
}
impl<'tcx> LayoutOfHelpers<'tcx> for Builder<'_, '_, 'tcx> {
type LayoutOfResult = TyAndLayout<'tcx>;
#[inline]
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
self.cx.handle_layout_err(err, span, ty)
@ -102,8 +100,6 @@ impl<'tcx> LayoutOfHelpers<'tcx> for Builder<'_, '_, 'tcx> {
}
impl<'tcx> FnAbiOfHelpers<'tcx> for Builder<'_, '_, 'tcx> {
type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>;
#[inline]
fn handle_fn_abi_err(
&self,