Skip to content

Commit f08f154

Browse files
nnethercotejackh726
authored andcommitted
Add a size assertion for RegionKind.
1 parent b15195a commit f08f154

File tree

1 file changed

+11
-4
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+11
-4
lines changed

compiler/rustc_middle/src/ty/sty.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,6 @@ impl<'tcx> Article for TyKind<'tcx> {
127127
}
128128
}
129129

130-
// `TyKind` is used a lot. Make sure it doesn't unintentionally get bigger.
131-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
132-
static_assert_size!(TyKind<'_>, 32);
133-
134130
/// A closure can be modeled as a struct that looks like:
135131
/// ```ignore (illustrative)
136132
/// struct Closure<'l0...'li, T0...Tj, CK, CS, U>(...U);
@@ -2496,3 +2492,14 @@ impl<'tcx> VarianceDiagInfo<'tcx> {
24962492
}
24972493
}
24982494
}
2495+
2496+
// Some types are used a lot. Make sure they don't unintentionally get bigger.
2497+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
2498+
mod size_asserts {
2499+
use super::*;
2500+
use rustc_data_structures::static_assert_size;
2501+
// tidy-alphabetical-start
2502+
static_assert_size!(RegionKind<'_>, 28);
2503+
static_assert_size!(TyKind<'_>, 32);
2504+
// tidy-alphabetical-end
2505+
}

0 commit comments

Comments
 (0)