From: Guillaume Gomez Date: Fri, 11 Aug 2017 08:20:23 +0000 (+0200) Subject: Rollup merge of #43741 - Gankro:fix-assert, r=eddyb X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=18238c7fa3999ef023d96ca04f1f74b1e0b9167a;hp=6047e9300cc40b3fd4f4470c28f40404d0bbde3c;p=rust.git Rollup merge of #43741 - Gankro:fix-assert, r=eddyb fix assertion - trait object pointers don't have infinite fields r? @eddyb --- diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index e770f1d55dc..4ee9b2e65a7 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -2197,8 +2197,8 @@ pub fn field_type>(&self, cx: C, i: usize) -> Ty<'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 {