diff options
| author | Roxane <roxane.fruytier@hotmail.com> | 2021-03-29 22:48:44 -0400 |
|---|---|---|
| committer | Roxane <roxane.fruytier@hotmail.com> | 2021-04-02 19:11:50 -0400 |
| commit | 0a97eee8df1f4a3182cd92786258ee5cf2baa43f (patch) | |
| tree | ff57df5c2cb332e3f2036c1112c9cdb72e21d9c5 /compiler/rustc_middle/src | |
| parent | 2fb1fb7634b79d93d48749ee1f84d4ba552b186f (diff) | |
| download | rust-0a97eee8df1f4a3182cd92786258ee5cf2baa43f.tar.gz rust-0a97eee8df1f4a3182cd92786258ee5cf2baa43f.zip | |
Reduce size of statements
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/visit.rs | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 1f7e12db47a..a7e9fc468b4 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1452,7 +1452,7 @@ pub struct Statement<'tcx> { // `Statement` is used a lot. Make sure it doesn't unintentionally get bigger. #[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))] -static_assert_size!(Statement<'_>, 40); +static_assert_size!(Statement<'_>, 32); impl Statement<'_> { /// Changes a statement to a nop. This is both faster than deleting instructions and avoids @@ -1482,7 +1482,7 @@ pub enum StatementKind<'tcx> { /// /// Note that this also is emitted for regular `let` bindings to ensure that locals that are /// never accessed still get some sanity checks for, e.g., `let x: ! = ..;` - FakeRead(FakeReadCause, Box<Place<'tcx>>), + FakeRead(Box<(FakeReadCause, Place<'tcx>)>), /// Write the discriminant for a variant to the enum Place. SetDiscriminant { place: Box<Place<'tcx>>, variant_index: VariantIdx }, @@ -1628,7 +1628,9 @@ impl Debug for Statement<'_> { use self::StatementKind::*; match self.kind { Assign(box (ref place, ref rv)) => write!(fmt, "{:?} = {:?}", place, rv), - FakeRead(ref cause, ref place) => write!(fmt, "FakeRead({:?}, {:?})", cause, place), + FakeRead(box (ref cause, ref place)) => { + write!(fmt, "FakeRead({:?}, {:?})", cause, place) + } Retag(ref kind, ref place) => write!( fmt, "Retag({}{:?})", diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index 32b4cd665d0..fd504f8c5d5 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -380,7 +380,7 @@ macro_rules! make_mir_visitor { ) => { self.visit_assign(place, rvalue, location); } - StatementKind::FakeRead(_, place) => { + StatementKind::FakeRead(box (_, place)) => { self.visit_place( place, PlaceContext::NonMutatingUse(NonMutatingUseContext::Inspect), |
