Rollup merge of #43741 - Gankro:fix-assert, r=eddyb

fix assertion - trait object pointers don't have infinite fields

r? @eddyb
This commit is contained in:
Guillaume Gomez 2017-08-11 10:20:23 +02:00 committed by GitHub
commit 18238c7fa3

View file

@ -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 {