about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexis Beingessner <a.beingessner@gmail.com>2017-08-08 10:08:08 -0400
committerAlexis Beingessner <a.beingessner@gmail.com>2017-08-08 10:08:08 -0400
commit6c0f2aa279113810cfc1076cf3cf09b1e140bb12 (patch)
treec4a7d30b358dbc0f9bb89d2f45611613b3d6e757
parentbcd75d661a421af74b063efa9ac5ac6e0d6529d7 (diff)
downloadrust-6c0f2aa279113810cfc1076cf3cf09b1e140bb12.tar.gz
rust-6c0f2aa279113810cfc1076cf3cf09b1e140bb12.zip
fix assertion - trait object pointers don't have infinite fields
-rw-r--r--src/librustc/ty/layout.rs2
1 files changed, 1 insertions, 1 deletions
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 @@ 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 {