Skip to content

Commit

Permalink
Auto merge of #115334 - RalfJung:transparent-aligned-zst, r=compiler-…
Browse files Browse the repository at this point in the history
…errors

repr(transparent): it's fine if the one non-1-ZST field is a ZST

This code currently gets rejected:
```rust
#[repr(transparent)]
struct MyType([u16; 0])
```
That clearly seems like a bug to me: `repr(transparent)` [got defined ](rust-lang/rust#77841 (comment)) as having any number of 1-ZST fields plus optionally one more field; `MyType` clearly satisfies that definition.

This PR changes the `repr(transparent)` logic to actually match that definition.
  • Loading branch information
bors committed Sep 17, 2023
2 parents 64c5f7a + ced5e1c commit f82fa4e
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit f82fa4e

Please sign in to comment.