Skip to content

Commit 37204ee

Browse files
committed
Use associative type defaults in {Layout,FnAbi}OfHelpers.
This avoids some repetitive boilerplate code.
1 parent 15848f3 commit 37204ee

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/common.rs

-8
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,13 @@ pub(crate) struct FunctionCx<'m, 'clif, 'tcx: 'm> {
309309
}
310310

311311
impl<'tcx> LayoutOfHelpers<'tcx> for FunctionCx<'_, '_, 'tcx> {
312-
type LayoutOfResult = TyAndLayout<'tcx>;
313-
314312
#[inline]
315313
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
316314
RevealAllLayoutCx(self.tcx).handle_layout_err(err, span, ty)
317315
}
318316
}
319317

320318
impl<'tcx> FnAbiOfHelpers<'tcx> for FunctionCx<'_, '_, 'tcx> {
321-
type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>;
322-
323319
#[inline]
324320
fn handle_fn_abi_err(
325321
&self,
@@ -450,8 +446,6 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
450446
pub(crate) struct RevealAllLayoutCx<'tcx>(pub(crate) TyCtxt<'tcx>);
451447

452448
impl<'tcx> LayoutOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
453-
type LayoutOfResult = TyAndLayout<'tcx>;
454-
455449
#[inline]
456450
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
457451
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
@@ -466,8 +460,6 @@ impl<'tcx> LayoutOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
466460
}
467461

468462
impl<'tcx> FnAbiOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
469-
type FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>;
470-
471463
#[inline]
472464
fn handle_fn_abi_err(
473465
&self,

0 commit comments

Comments
 (0)