Skip to content

Commit

Permalink
Add a size assertion for LocalDecl.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed May 6, 2020
1 parent afd8a4e commit cda1627
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_middle/mir/mod.rs
Expand Up @@ -816,6 +816,10 @@ pub struct LocalDecl<'tcx> {
pub source_info: SourceInfo,
}

// `LocalDecl` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
static_assert_size!(LocalDecl<'_>, 128);

/// Extra information about a local that's used for diagnostics.
#[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
pub enum LocalInfo<'tcx> {
Expand Down

0 comments on commit cda1627

Please sign in to comment.