Skip to content

Commit 2d47cd7

Browse files
committed
Check x86_64 size assertions on aarch64, too
This makes it easier for contributors on aarch64 workstations (e.g. Macs) to notice when these assertions have been violated.
1 parent b688d53 commit 2d47cd7

File tree

33 files changed

+36
-36
lines changed

33 files changed

+36
-36
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3341,7 +3341,7 @@ impl TryFrom<ItemKind> for ForeignItemKind {
33413341
pub type ForeignItem = Item<ForeignItemKind>;
33423342

33433343
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
3344-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
3344+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
33453345
mod size_asserts {
33463346
use super::*;
33473347
use rustc_data_structures::static_assert_size;

compiler/rustc_ast/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ where
10211021
}
10221022

10231023
// Some types are used a lot. Make sure they don't unintentionally get bigger.
1024-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
1024+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
10251025
mod size_asserts {
10261026
use super::*;
10271027
use rustc_data_structures::static_assert_size;

compiler/rustc_ast/src/tokenstream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ impl DelimSpacing {
768768
}
769769

770770
// Some types are used a lot. Make sure they don't unintentionally get bigger.
771-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
771+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
772772
mod size_asserts {
773773
use super::*;
774774
use rustc_data_structures::static_assert_size;

compiler/rustc_const_eval/src/interpret/operand.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
792792
}
793793

794794
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
795-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
795+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
796796
mod size_asserts {
797797
use super::*;
798798
use rustc_data_structures::static_assert_size;

compiler/rustc_const_eval/src/interpret/place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ where
10581058
}
10591059

10601060
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
1061-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
1061+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
10621062
mod size_asserts {
10631063
use super::*;
10641064
use rustc_data_structures::static_assert_size;

compiler/rustc_errors/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ pub type PResult<'a, T> = Result<T, PErr<'a>>;
102102
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
103103

104104
// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
105-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
105+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
106106
rustc_data_structures::static_assert_size!(PResult<'_, ()>, 16);
107-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
107+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
108108
rustc_data_structures::static_assert_size!(PResult<'_, bool>, 16);
109109

110110
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Encodable, Decodable)]

compiler/rustc_expand/src/mbe/macro_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ struct MatcherPos {
266266
}
267267

268268
// This type is used a lot. Make sure it doesn't unintentionally get bigger.
269-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
269+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
270270
rustc_data_structures::static_assert_size!(MatcherPos, 16);
271271

272272
impl MatcherPos {

compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3762,7 +3762,7 @@ impl<'hir> Node<'hir> {
37623762
}
37633763

37643764
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
3765-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
3765+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
37663766
mod size_asserts {
37673767
use super::*;
37683768
// tidy-alphabetical-start

compiler/rustc_index/src/bit_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ enum Chunk {
400400
}
401401

402402
// This type is used a lot. Make sure it doesn't unintentionally get bigger.
403-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
403+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
404404
crate::static_assert_size!(Chunk, 16);
405405

406406
impl<T> ChunkedBitSet<T> {

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ pub enum SubregionOrigin<'tcx> {
483483
}
484484

485485
// `SubregionOrigin` is used a lot. Make sure it doesn't unintentionally get bigger.
486-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
486+
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
487487
static_assert_size!(SubregionOrigin<'_>, 32);
488488

489489
impl<'tcx> SubregionOrigin<'tcx> {

0 commit comments

Comments
 (0)