[`no_mangle_with_rust_abi`]: Check for statics with a non `#[repr(Rust)]` type by Centri3 · Pull Request #11253 · rust-lang/rust-clippy
ojeda
mentioned this pull request
71 tasks
bors added a commit to rust-lang-ci/rust that referenced this pull request
Aug 25, 2023…Lapkin 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.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request
Aug 26, 2023Allow 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.
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request
Apr 7, 2024Allow 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.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request
Apr 27, 2024Allow 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.
Kobzol pushed a commit to Kobzol/portable-simd that referenced this pull request
Feb 3, 2026Allow 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters