From 6c0f2aa279113810cfc1076cf3cf09b1e140bb12 Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Tue, 8 Aug 2017 10:08:08 -0400 Subject: [PATCH] fix assertion - trait object pointers don't have infinite fields --- src/librustc/ty/layout.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index e770f1d55dcfd..4ee9b2e65a782 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -2197,8 +2197,8 @@ impl<'a, 'tcx> TyLayout<'tcx> { let tcx = cx.tcx(); let ptr_field_type = |pointee: Ty<'tcx>| { + assert!(i < 2); let slice = |element: Ty<'tcx>| { - assert!(i < 2); if i == 0 { tcx.mk_mut_ptr(element) } else {