Skip to content

Commit

Permalink
More readable condition
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-abram committed Nov 22, 2020
1 parent 2825e53 commit 2af9121
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_target/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1163,9 +1163,7 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
match &self.fields {
FieldsShape::Primitive | FieldsShape::Union { .. } => {}
FieldsShape::Array { count, .. } => {
if !(*count == 0
|| self.field(cx, 0).to_result()?.might_permit_raw_init(cx, zero)?)
{
if *count > 0 && !self.field(cx, 0).to_result()?.might_permit_raw_init(cx, zero)? {
// Found non empty array with a type that is unhappy about this kind of initialization
return Ok(false);
}
Expand Down

0 comments on commit 2af9121

Please sign in to comment.