about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/ty/layout.rs3
-rw-r--r--src/librustc_trans/debuginfo/metadata.rs1
-rw-r--r--src/librustc_trans/mir/lvalue.rs2
3 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs
index 4fea7ee082c..a7c707de481 100644
--- a/src/librustc/ty/layout.rs
+++ b/src/librustc/ty/layout.rs
@@ -1145,7 +1145,6 @@ pub enum Layout {
     StructWrappedNullablePointer {
         nndiscr: u64,
         nonnull: Struct,
-        /// N.B. There is a 0 at the start, for LLVM GEP through a pointer.
         discrfield: FieldPath,
         /// Like discrfield, but in source order. For debuginfo.
         discrfield_source: FieldPath
@@ -1472,9 +1471,7 @@ impl<'a, 'tcx> Layout {
                         let mut i = *path.last().unwrap();
                         i = st.memory_index[i as usize];
                         *path.last_mut().unwrap() = i;
-                        path.push(0); // For GEP through a pointer.
                         path.reverse();
-                        path_source.push(0);
                         path_source.reverse();
 
                         return success(StructWrappedNullablePointer {
diff --git a/src/librustc_trans/debuginfo/metadata.rs b/src/librustc_trans/debuginfo/metadata.rs
index 879a7467857..82c975c751f 100644
--- a/src/librustc_trans/debuginfo/metadata.rs
+++ b/src/librustc_trans/debuginfo/metadata.rs
@@ -1312,7 +1312,6 @@ impl<'tcx> EnumMemberDescriptionFactory<'tcx> {
                 let null_variant_index = (1 - nndiscr) as usize;
                 let null_variant_name = adt.variants[null_variant_index].name;
                 let discrfield_source = discrfield_source.iter()
-                                           .skip(1)
                                            .map(|x| x.to_string())
                                            .collect::<Vec<_>>().join("$");
                 let union_member_name = format!("RUST$ENCODED$ENUM${}${}",
diff --git a/src/librustc_trans/mir/lvalue.rs b/src/librustc_trans/mir/lvalue.rs
index c11596b0140..7cf35c4405c 100644
--- a/src/librustc_trans/mir/lvalue.rs
+++ b/src/librustc_trans/mir/lvalue.rs
@@ -332,7 +332,7 @@ impl<'a, 'tcx> LvalueRef<'tcx> {
 
     // Double index to account for padding (FieldPath already uses `Struct::memory_index`)
     fn gepi_struct_llfields_path(self, bcx: &Builder, discrfield: &layout::FieldPath) -> ValueRef {
-        let path = iter::once(C_u32(bcx.ccx, 0)).chain(discrfield[1..].iter().map(|&i| {
+        let path = iter::once(C_u32(bcx.ccx, 0)).chain(discrfield.iter().map(|&i| {
             let i = adt::memory_index_to_gep(i as u64);
             assert_eq!(i as u32 as u64, i);
             C_u32(bcx.ccx, i as u32)