Rollup merge of #124463 - gurry:rename-func, r=TaKO8Ki

Rename `inhibit_union_abi_opt()` to `inhibits_union_abi_opt()`

`inihibit` seems to suggest that this function will inhibit optimizations whereas `inhibits` correctly indicates that it will merely _check_ that. With `inhibits` if conditions read more naturally e.g.:

```rust
if repr.inhibits_union_abi_opt() {
}
```
This commit is contained in:
Matthias Krüger 2024-04-28 13:34:42 +02:00 committed by GitHub
commit 7ab3997970
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -251,7 +251,7 @@ fn layout_of_union<
// If all the non-ZST fields have the same ABI and union ABI optimizations aren't
// disabled, we can use that common ABI for the union as a whole.
struct AbiMismatch;
let mut common_non_zst_abi_and_align = if repr.inhibit_union_abi_opt() {
let mut common_non_zst_abi_and_align = if repr.inhibits_union_abi_opt() {
// Can't optimize
Err(AbiMismatch)
} else {

View File

@ -155,7 +155,7 @@ pub fn can_randomize_type_layout(&self) -> bool {
}
/// Returns `true` if this `#[repr()]` should inhibit union ABI optimisations.
pub fn inhibit_union_abi_opt(&self) -> bool {
pub fn inhibits_union_abi_opt(&self) -> bool {
self.c()
}
}