From 4aafec1bc1c1cb860f38fad9e4d11f37f38c573f Mon Sep 17 00:00:00 2001 From: Gurinder Singh Date: Sun, 28 Apr 2024 13:09:36 +0530 Subject: [PATCH] Rename `inihibit_union_abi_opt()` to `inihibits_union_abi_opt()` The present tense makes it read more naturally at use site i.e. "this repr _inhibits_ optimizations" --- compiler/rustc_abi/src/layout.rs | 2 +- compiler/rustc_abi/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs index 3584eea0f14..a95ef4c460f 100644 --- a/compiler/rustc_abi/src/layout.rs +++ b/compiler/rustc_abi/src/layout.rs @@ -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 { diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 7439af7aed3..a46148242d5 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -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() } }