Skip to content

Commit e61363c

Browse files
committed
chore: Fix typos in comments across layout.rs and lib.rs files
Corrected spelling errors in comments to improve clarity and maintain consistency in terminology. Changes include: - "initialised" to "initialized" - "optimisation" to "optimization" - "realising" to "realizing" These updates enhance the readability of the code without altering functionality.
1 parent bc3e301 commit e61363c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

compiler/rustc_abi/src/layout.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
636636
// same ABI as the scalar variant with the reserved niche.
637637
BackendRepr::Scalar(_) => BackendRepr::Scalar(niche_scalar),
638638
BackendRepr::ScalarPair(first, second) => {
639-
// Only the niche is guaranteed to be initialised,
639+
// Only the niche is guaranteed to be initialized,
640640
// so use union layouts for the other primitive.
641641
if niche_offset == Size::ZERO {
642642
BackendRepr::ScalarPair(niche_scalar, second.to_union())
@@ -777,7 +777,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
777777
panic!(
778778
"layout decided on a larger discriminant type ({min_ity:?}) than typeck ({typeck_ity:?})"
779779
);
780-
// However, it is fine to make discr type however large (as an optimisation)
780+
// However, it is fine to make discr type however large (as an optimization)
781781
// after this point – we’ll just truncate the value we load in codegen.
782782
}
783783

@@ -883,7 +883,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
883883
break;
884884
}
885885
// This is pretty conservative. We could go fancier
886-
// by realising that (u8, u8) could just cohabit with
886+
// by realizing that (u8, u8) could just cohabit with
887887
// u16 or even u32.
888888
let new_prim = match (old_prim, prim) {
889889
// Allow all identical primitives.

compiler/rustc_abi/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bitflags! {
9595
// Other flags can still inhibit reordering and thus randomization.
9696
// The seed stored in `ReprOptions.field_shuffle_seed`.
9797
const RANDOMIZE_LAYOUT = 1 << 4;
98-
// Any of these flags being set prevent field reordering optimisation.
98+
// Any of these flags being set prevent field reordering optimization.
9999
const FIELD_ORDER_UNOPTIMIZABLE = ReprFlags::IS_C.bits()
100100
| ReprFlags::IS_SIMD.bits()
101101
| ReprFlags::IS_LINEAR.bits();
@@ -204,7 +204,7 @@ impl ReprOptions {
204204
!self.inhibit_struct_field_reordering() && self.flags.contains(ReprFlags::RANDOMIZE_LAYOUT)
205205
}
206206

207-
/// Returns `true` if this `#[repr()]` should inhibit union ABI optimisations.
207+
/// Returns `true` if this `#[repr()]` should inhibit union ABI optimizations.
208208
pub fn inhibits_union_abi_opt(&self) -> bool {
209209
self.c()
210210
}

0 commit comments

Comments
 (0)