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:
commit
7ab3997970
@ -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 {
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user