Skip to content

Commit cd75af2

Browse files
committed
Change more x64 size checks to not apply to x32.
Commit 95e096d changed a bunch of size checks already, but more have been added, so this fixes the new ones the same way: the various size checks that are conditional on target_arch = "x86_64" were not intended to apply to x86_64-unknown-linux-gnux32, so add target_pointer_width = "64" to the conditions.
1 parent f7c00dc commit cd75af2

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/rustc_middle/src/mir/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ pub struct Place<'tcx> {
17081708
pub projection: &'tcx List<PlaceElem<'tcx>>,
17091709
}
17101710

1711-
#[cfg(target_arch = "x86_64")]
1711+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
17121712
static_assert_size!(Place<'_>, 16);
17131713

17141714
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -2034,7 +2034,7 @@ pub enum Operand<'tcx> {
20342034
Constant(Box<Constant<'tcx>>),
20352035
}
20362036

2037-
#[cfg(target_arch = "x86_64")]
2037+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
20382038
static_assert_size!(Operand<'_>, 24);
20392039

20402040
impl<'tcx> Debug for Operand<'tcx> {
@@ -2172,7 +2172,7 @@ pub enum Rvalue<'tcx> {
21722172
Aggregate(Box<AggregateKind<'tcx>>, Vec<Operand<'tcx>>),
21732173
}
21742174

2175-
#[cfg(target_arch = "x86_64")]
2175+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
21762176
static_assert_size!(Rvalue<'_>, 40);
21772177

21782178
#[derive(Clone, Copy, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
@@ -2198,7 +2198,7 @@ pub enum AggregateKind<'tcx> {
21982198
Generator(DefId, SubstsRef<'tcx>, hir::Movability),
21992199
}
22002200

2201-
#[cfg(target_arch = "x86_64")]
2201+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
22022202
static_assert_size!(AggregateKind<'_>, 48);
22032203

22042204
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, TyEncodable, TyDecodable, Hash, HashStable)]

compiler/rustc_parse/src/parser/attr_wrapper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub struct AttrWrapper {
3434

3535
// This struct is passed around very frequently,
3636
// so make sure it doesn't accidentally get larger
37-
#[cfg(target_arch = "x86_64")]
37+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
3838
rustc_data_structures::static_assert_size!(AttrWrapper, 16);
3939

4040
impl AttrWrapper {

src/librustdoc/html/render/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ crate struct Context<'tcx> {
6969
}
7070

7171
// `Context` is cloned a lot, so we don't want the size to grow unexpectedly.
72-
#[cfg(target_arch = "x86_64")]
72+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
7373
rustc_data_structures::static_assert_size!(Context<'_>, 104);
7474

7575
/// Shared mutable state used in [`Context`] and elsewhere.

0 commit comments

Comments
 (0)