Skip to content

Commit

Permalink
Auto merge of #114201 - Centri3:explicit-repr-rust, r=WaffleLapkin
Browse files Browse the repository at this point in the history
Allow explicit `#[repr(Rust)]`

This is identical to no `repr()` at all. For `Rust, packed` and `Rust, align(x)`, it should be the same as no `Rust` at all (as, afaik, `#[repr(align(16))]` uses the Rust ABI.)

The main use case for this is being able to explicitly say "I want to use the Rust ABI" in very very rare circumstances where the first obvious choice would be the C ABI yet is undesirable, which is already possible with functions as `extern "Rust"`. This would be useful for silencing rust-lang/rust-clippy#11253. It's also more consistent with `extern`.

The lack of this also tripped me up a bit when I was new to Rust, as I expected this to be possible.
  • Loading branch information
bors committed Aug 25, 2023
2 parents f4e10fb + a7d6400 commit eebaa53
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit eebaa53

Please sign in to comment.