@@ -75,7 +75,7 @@ fn uncached_gcc_type<'gcc, 'tcx>(
7575 } ;
7676 return cx. context . new_vector_type ( element, count) ;
7777 }
78- BackendRepr :: ScalarPair ( .. ) => {
78+ BackendRepr :: ScalarPair { .. } => {
7979 return cx. type_struct (
8080 & [
8181 layout. scalar_pair_element_gcc_type ( cx, 0 ) ,
@@ -182,13 +182,13 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
182182 BackendRepr :: Scalar ( _) | BackendRepr :: SimdVector { .. } => true ,
183183 // FIXME(rustc_scalable_vector): Not yet implemented in rustc_codegen_gcc.
184184 BackendRepr :: SimdScalableVector { .. } => todo ! ( ) ,
185- BackendRepr :: ScalarPair ( .. ) | BackendRepr :: Memory { .. } => false ,
185+ BackendRepr :: ScalarPair { .. } | BackendRepr :: Memory { .. } => false ,
186186 }
187187 }
188188
189189 fn is_gcc_scalar_pair ( & self ) -> bool {
190190 match self . backend_repr {
191- BackendRepr :: ScalarPair ( .. ) => true ,
191+ BackendRepr :: ScalarPair { .. } => true ,
192192 BackendRepr :: Scalar ( _)
193193 | BackendRepr :: SimdVector { .. }
194194 | BackendRepr :: SimdScalableVector { .. }
@@ -308,8 +308,8 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
308308 // This must produce the same result for `repr(transparent)` wrappers as for the inner type!
309309 // In other words, this should generally not look at the type at all, but only at the
310310 // layout.
311- let ( a, b) = match self . backend_repr {
312- BackendRepr :: ScalarPair ( ref a, ref b) => ( a, b) ,
311+ let ( a, b, b_offset ) = match self . backend_repr {
312+ BackendRepr :: ScalarPair { ref a, ref b, b_offset } => ( a, b, b_offset ) ,
313313 _ => bug ! ( "TyAndLayout::scalar_pair_element_llty({:?}): not applicable" , self ) ,
314314 } ;
315315 let scalar = [ a, b] [ index] ;
@@ -325,8 +325,7 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
325325 return cx. type_i1 ( ) ;
326326 }
327327
328- let offset =
329- if index == 0 { Size :: ZERO } else { a. size ( cx) . align_to ( b. default_align ( cx) . abi ) } ;
328+ let offset = if index == 0 { Size :: ZERO } else { b_offset } ;
330329 self . scalar_gcc_type_at ( cx, scalar, offset)
331330 }
332331
0 commit comments