Skip to content

Commit 7ab3997

Browse files
authored
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() { } ```
2 parents a777138 + 4aafec1 commit 7ab3997

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_abi/src/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub trait LayoutCalculator {
251251
// If all the non-ZST fields have the same ABI and union ABI optimizations aren't
252252
// disabled, we can use that common ABI for the union as a whole.
253253
struct AbiMismatch;
254-
let mut common_non_zst_abi_and_align = if repr.inhibit_union_abi_opt() {
254+
let mut common_non_zst_abi_and_align = if repr.inhibits_union_abi_opt() {
255255
// Can't optimize
256256
Err(AbiMismatch)
257257
} else {

compiler/rustc_abi/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl ReprOptions {
155155
}
156156

157157
/// Returns `true` if this `#[repr()]` should inhibit union ABI optimisations.
158-
pub fn inhibit_union_abi_opt(&self) -> bool {
158+
pub fn inhibits_union_abi_opt(&self) -> bool {
159159
self.c()
160160
}
161161
}

0 commit comments

Comments
 (0)