Skip to content

Commit 7b514cd

Browse files
Rollup merge of #88668 - hvdijk:x32, r=joshtriplett
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.
2 parents 3af42a8 + cd75af2 commit 7b514cd

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
@@ -1736,7 +1736,7 @@ pub struct Place<'tcx> {
17361736
pub projection: &'tcx List<PlaceElem<'tcx>>,
17371737
}
17381738

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

17421742
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@@ -2062,7 +2062,7 @@ pub enum Operand<'tcx> {
20622062
Constant(Box<Constant<'tcx>>),
20632063
}
20642064

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

20682068
impl<'tcx> Debug for Operand<'tcx> {
@@ -2200,7 +2200,7 @@ pub enum Rvalue<'tcx> {
22002200
Aggregate(Box<AggregateKind<'tcx>>, Vec<Operand<'tcx>>),
22012201
}
22022202

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

22062206
#[derive(Clone, Copy, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
@@ -2226,7 +2226,7 @@ pub enum AggregateKind<'tcx> {
22262226
Generator(DefId, SubstsRef<'tcx>, hir::Movability),
22272227
}
22282228

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

22322232
#[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)