Skip to content

Commit ca06df9

Browse files
committed
Add a size assertion for RegionKind.
1 parent de74dab commit ca06df9

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,6 @@ impl<'tcx> Article for TyKind<'tcx> {
136136
}
137137
}
138138

139-
// `TyKind` is used a lot. Make sure it doesn't unintentionally get bigger.
140-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
141-
static_assert_size!(TyKind<'_>, 32);
142-
143139
/// A closure can be modeled as a struct that looks like:
144140
/// ```ignore (illustrative)
145141
/// struct Closure<'l0...'li, T0...Tj, CK, CS, U>(...U);
@@ -2514,3 +2510,14 @@ impl<'tcx> VarianceDiagInfo<'tcx> {
25142510
}
25152511
}
25162512
}
2513+
2514+
// Some types are used a lot. Make sure they don't unintentionally get bigger.
2515+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
2516+
mod size_asserts {
2517+
use super::*;
2518+
use rustc_data_structures::static_assert_size;
2519+
// tidy-alphabetical-start
2520+
static_assert_size!(RegionKind<'_>, 32);
2521+
static_assert_size!(TyKind<'_>, 32);
2522+
// tidy-alphabetical-end
2523+
}

0 commit comments

Comments
 (0)