File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -1623,15 +1623,13 @@ impl ImproperCTypesDefinitions {
16231623 cx : & LateContext < ' tcx > ,
16241624 ty : Ty < ' tcx > ,
16251625 ) -> bool {
1626+ assert ! ( cx. tcx. sess. target. os == "aix" ) ;
16261627 // Structs (under repr(C)) follow the power alignment rule if:
16271628 // - the first field of the struct is a floating-point type that
16281629 // is greater than 4-bytes, or
16291630 // - the first field of the struct is an aggregate whose
16301631 // recursively first field is a floating-point type greater than
16311632 // 4 bytes.
1632- if cx. tcx . sess . target . os != "aix" {
1633- return false ;
1634- }
16351633 if ty. is_floating_point ( ) && ty. primitive_size ( cx. tcx ) . bytes ( ) > 4 {
16361634 return true ;
16371635 } else if let Adt ( adt_def, _) = ty. kind ( )
@@ -1668,15 +1666,11 @@ impl ImproperCTypesDefinitions {
16681666 // power alignment rule, as fields after the first are likely
16691667 // to be the fields that are misaligned.
16701668 if index != 0 {
1671- let first_field_def = struct_variant_data. fields ( ) [ index] ;
1672- let def_id = first_field_def . def_id ;
1669+ let field_def = struct_variant_data. fields ( ) [ index] ;
1670+ let def_id = field_def . def_id ;
16731671 let ty = cx. tcx . type_of ( def_id) . instantiate_identity ( ) ;
16741672 if self . check_arg_for_power_alignment ( cx, ty) {
1675- cx. emit_span_lint (
1676- USES_POWER_ALIGNMENT ,
1677- first_field_def. span ,
1678- UsesPowerAlignment ,
1679- ) ;
1673+ cx. emit_span_lint ( USES_POWER_ALIGNMENT , field_def. span , UsesPowerAlignment ) ;
16801674 }
16811675 }
16821676 }
You can’t perform that action at this time.
0 commit comments