about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-04-17 03:54:58 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-04-17 04:58:37 +0300
commitaabed9322e78b280d54fe7a90bb088932731d967 (patch)
tree33c2e93f7e8f69cce0893c58b1648b7f12886bbe
parent2472e04291c6f69ce3f469838ebbeeefcbe2e529 (diff)
downloadrust-aabed9322e78b280d54fe7a90bb088932731d967.tar.gz
rust-aabed9322e78b280d54fe7a90bb088932731d967.zip
mir: pretty-print `Rvalue::Aggregate` correctly.
-rw-r--r--src/librustc_middle/mir/mod.rs32
-rw-r--r--src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/deaggregator_test_enum_2/rustc.test1.Deaggregator.diff4
-rw-r--r--src/test/mir-opt/deaggregator_test_multiple/rustc.test.Deaggregator.diff4
-rw-r--r--src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir4
-rw-r--r--src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir2
-rw-r--r--src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir2
-rw-r--r--src/test/mir-opt/issue-62289/rustc.test.ElaborateDrops.before.mir2
-rw-r--r--src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir2
-rw-r--r--src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir2
-rw-r--r--src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir2
-rw-r--r--src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir10
-rw-r--r--src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir10
-rw-r--r--src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir4
-rw-r--r--src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir2
16 files changed, 44 insertions, 42 deletions
diff --git a/src/librustc_middle/mir/mod.rs b/src/librustc_middle/mir/mod.rs
index 212061cfd82..2d3f8b4b251 100644
--- a/src/librustc_middle/mir/mod.rs
+++ b/src/librustc_middle/mir/mod.rs
@@ -2242,39 +2242,41 @@ impl<'tcx> Debug for Rvalue<'tcx> {
             }
 
             Aggregate(ref kind, ref places) => {
-                fn fmt_tuple(fmt: &mut Formatter<'_>, places: &[Operand<'_>]) -> fmt::Result {
-                    let mut tuple_fmt = fmt.debug_tuple("");
+                let fmt_tuple = |fmt: &mut Formatter<'_>, name: &str| {
+                    let mut tuple_fmt = fmt.debug_tuple(name);
                     for place in places {
                         tuple_fmt.field(place);
                     }
                     tuple_fmt.finish()
-                }
+                };
 
                 match **kind {
                     AggregateKind::Array(_) => write!(fmt, "{:?}", places),
 
-                    AggregateKind::Tuple => match places.len() {
-                        0 => write!(fmt, "()"),
-                        1 => write!(fmt, "({:?},)", places[0]),
-                        _ => fmt_tuple(fmt, places),
-                    },
+                    AggregateKind::Tuple => {
+                        if places.is_empty() {
+                            write!(fmt, "()")
+                        } else {
+                            fmt_tuple(fmt, "")
+                        }
+                    }
 
                     AggregateKind::Adt(adt_def, variant, substs, _user_ty, _) => {
                         let variant_def = &adt_def.variants[variant];
 
-                        let f = &mut *fmt;
-                        ty::tls::with(|tcx| {
+                        let name = ty::tls::with(|tcx| {
+                            let mut name = String::new();
                             let substs = tcx.lift(&substs).expect("could not lift for printing");
-                            FmtPrinter::new(tcx, f, Namespace::ValueNS)
+                            FmtPrinter::new(tcx, &mut name, Namespace::ValueNS)
                                 .print_def_path(variant_def.def_id, substs)?;
-                            Ok(())
+                            Ok(name)
                         })?;
 
                         match variant_def.ctor_kind {
-                            CtorKind::Const => Ok(()),
-                            CtorKind::Fn => fmt_tuple(fmt, places),
+                            CtorKind::Const => fmt.write_str(&name),
+                            CtorKind::Fn => fmt_tuple(fmt, &name),
                             CtorKind::Fictive => {
-                                let mut struct_fmt = fmt.debug_struct("");
+                                let mut struct_fmt = fmt.debug_struct(&name);
                                 for (field, place) in variant_def.fields.iter().zip(places) {
                                     struct_fmt.field(&field.ident.as_str(), place);
                                 }
diff --git a/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff
index f89d869cab5..d5566b9d761 100644
--- a/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff
@@ -15,7 +15,7 @@
           StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/discriminant.rs:6:9: 6:10
           StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
           StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
--         _3 = std::option::Option::<bool>::Some(const true,); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
+-         _3 = std::option::Option::<bool>::Some(const true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
 +         _3 = const {transmute(0x01): std::option::Option<bool>}; // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
                                            // ty::Const
 -                                          // + ty: bool
diff --git a/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff
index 06f43db50f4..bdd9c020c95 100644
--- a/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff
@@ -15,7 +15,7 @@
           StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/discriminant.rs:6:9: 6:10
           StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
           StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
--         _3 = std::option::Option::<bool>::Some(const true,); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
+-         _3 = std::option::Option::<bool>::Some(const true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
 +         _3 = const {transmute(0x01): std::option::Option<bool>}; // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
                                            // ty::Const
 -                                          // + ty: bool
diff --git a/src/test/mir-opt/deaggregator_test_enum_2/rustc.test1.Deaggregator.diff b/src/test/mir-opt/deaggregator_test_enum_2/rustc.test1.Deaggregator.diff
index a72a679b209..3256e59e3eb 100644
--- a/src/test/mir-opt/deaggregator_test_enum_2/rustc.test1.Deaggregator.diff
+++ b/src/test/mir-opt/deaggregator_test_enum_2/rustc.test1.Deaggregator.diff
@@ -18,7 +18,7 @@
       bb1: {
           StorageLive(_5);                 // bb1[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
           _5 = _2;                         // bb1[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
--         _0 = Foo::B(move _5,);           // bb1[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
+-         _0 = Foo::B(move _5);            // bb1[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
 -         StorageDead(_5);                 // bb1[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18
 -         goto -> bb3;                     // bb1[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
 +         ((_0 as B).0: i32) = move _5;    // bb1[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
@@ -30,7 +30,7 @@
       bb2: {
           StorageLive(_4);                 // bb2[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
           _4 = _2;                         // bb2[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
--         _0 = Foo::A(move _4,);           // bb2[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
+-         _0 = Foo::A(move _4);            // bb2[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
 -         StorageDead(_4);                 // bb2[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18
 -         goto -> bb3;                     // bb2[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
 +         ((_0 as A).0: i32) = move _4;    // bb2[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
diff --git a/src/test/mir-opt/deaggregator_test_multiple/rustc.test.Deaggregator.diff b/src/test/mir-opt/deaggregator_test_multiple/rustc.test.Deaggregator.diff
index 126dfc1ac91..7d3ae6a16b2 100644
--- a/src/test/mir-opt/deaggregator_test_multiple/rustc.test.Deaggregator.diff
+++ b/src/test/mir-opt/deaggregator_test_multiple/rustc.test.Deaggregator.diff
@@ -13,12 +13,12 @@
           StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
           StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
           _3 = _1;                         // bb0[2]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
--         _2 = Foo::A(move _3,);           // bb0[3]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
+-         _2 = Foo::A(move _3);            // bb0[3]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
 -         StorageDead(_3);                 // bb0[4]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:14: 10:15
 -         StorageLive(_4);                 // bb0[5]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
 -         StorageLive(_5);                 // bb0[6]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
 -         _5 = _1;                         // bb0[7]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
--         _4 = Foo::A(move _5,);           // bb0[8]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
+-         _4 = Foo::A(move _5);            // bb0[8]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
 -         StorageDead(_5);                 // bb0[9]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:25: 10:26
 -         _0 = [move _2, move _4];         // bb0[10]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:5: 10:27
 -         StorageDead(_4);                 // bb0[11]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
diff --git a/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir b/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir
index 50a48f2eee4..5d5f9dcc61d 100644
--- a/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir
+++ b/src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir
@@ -21,7 +21,7 @@ yields ()
 
     bb0: {
         StorageLive(_3);                 // bb0[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
-        _3 = Foo(const 5i32,);           // bb0[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
+        _3 = Foo(const 5i32);            // bb0[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000005))
@@ -29,7 +29,7 @@ yields ()
                                          // + span: $DIR/generator-storage-dead-unwind.rs:23:21: 23:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
         StorageLive(_4);                 // bb0[2]: scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
-        _4 = Bar(const 6i32,);           // bb0[3]: scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
+        _4 = Bar(const 6i32);            // bb0[3]: scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000006))
diff --git a/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir b/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir
index 2e3354699fb..dbab6ceffdc 100644
--- a/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir
+++ b/src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir
@@ -34,7 +34,7 @@ fn main::{{closure}}#0(_1: std::pin::Pin<&mut [generator@$DIR/generator-tiny.rs:
         StorageLive(_6);                 // bb2[0]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
         StorageLive(_7);                 // bb2[1]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
         _7 = ();                         // bb2[2]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
-        _0 = std::ops::GeneratorState::<(), ()>::Yielded(move _7,); // bb2[3]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+        _0 = std::ops::GeneratorState::<(), ()>::Yielded(move _7); // bb2[3]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
         discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))) = 3; // bb2[4]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
         return;                          // bb2[5]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
     }
diff --git a/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir b/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir
index ee05bf48d62..fe376f2a048 100644
--- a/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir
+++ b/src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir
@@ -80,7 +80,7 @@ fn main() -> () {
         StorageLive(_3);                 // bb5[0]: scope 1 at $DIR/issue-41888.rs:9:13: 9:20
         StorageLive(_4);                 // bb5[1]: scope 1 at $DIR/issue-41888.rs:9:18: 9:19
         _4 = K;                          // bb5[2]: scope 1 at $DIR/issue-41888.rs:9:18: 9:19
-        _3 = E::F(move _4,);             // bb5[3]: scope 1 at $DIR/issue-41888.rs:9:13: 9:20
+        _3 = E::F(move _4);              // bb5[3]: scope 1 at $DIR/issue-41888.rs:9:13: 9:20
         StorageDead(_4);                 // bb5[4]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
         goto -> bb14;                    // bb5[5]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
     }
diff --git a/src/test/mir-opt/issue-62289/rustc.test.ElaborateDrops.before.mir b/src/test/mir-opt/issue-62289/rustc.test.ElaborateDrops.before.mir
index c2f91980021..8970cc83f2b 100644
--- a/src/test/mir-opt/issue-62289/rustc.test.ElaborateDrops.before.mir
+++ b/src/test/mir-opt/issue-62289/rustc.test.ElaborateDrops.before.mir
@@ -115,7 +115,7 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
 
     bb12: {
         StorageDead(_2);                 // bb12[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
-        _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1,); // bb12[1]: scope 0 at $DIR/issue-62289.rs:9:5: 9:22
+        _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1); // bb12[1]: scope 0 at $DIR/issue-62289.rs:9:5: 9:22
         drop(_1) -> bb13;                // bb12[2]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
     }
 
diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
index a296bd05312..0f8b6cc9c84 100644
--- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
+++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
@@ -26,7 +26,7 @@ fn full_tested_match() -> () {
     bb0: {
         StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
         StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        _2 = std::option::Option::<i32>::Some(const 42i32,); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+        _2 = std::option::Option::<i32>::Some(const 42i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x0000002a))
diff --git a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
index 567e3ebdd93..2cf6c97ae22 100644
--- a/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
+++ b/src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
@@ -25,7 +25,7 @@ fn full_tested_match2() -> () {
     bb0: {
         StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
         StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        _2 = std::option::Option::<i32>::Some(const 42i32,); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+        _2 = std::option::Option::<i32>::Some(const 42i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x0000002a))
diff --git a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir
index a24fa9dedb3..7bba0b20d8e 100644
--- a/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir
+++ b/src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir
@@ -36,7 +36,7 @@ fn main() -> () {
     bb0: {
         StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
         StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        _2 = std::option::Option::<i32>::Some(const 1i32,); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+        _2 = std::option::Option::<i32>::Some(const 1i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
diff --git a/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
index cea10872942..cf423d06efb 100644
--- a/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
@@ -16,27 +16,27 @@ fn main() -> () {
         StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
         StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
         StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
-        _3 = Droppy(const 0usize,);      // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+        _3 = Droppy(const 0usize);       // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-        _2 = Aligned(move _3,);          // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+        _2 = Aligned(move _3);           // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
         StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
-        _1 = Packed(move _2,);           // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
+        _1 = Packed(move _2);            // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
         StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
         StorageLive(_4);                 // bb0[8]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
         StorageLive(_5);                 // bb0[9]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
-        _5 = Droppy(const 0usize,);      // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+        _5 = Droppy(const 0usize);       // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-        _4 = Aligned(move _5,);          // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+        _4 = Aligned(move _5);           // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
         StorageDead(_5);                 // bb0[12]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
         StorageLive(_6);                 // bb0[13]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
         _6 = move (_1.0: Aligned);       // bb0[14]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
diff --git a/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
index 432f91d91e5..09b398e9604 100644
--- a/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
@@ -16,27 +16,27 @@ fn main() -> () {
         StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
         StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
         StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
-        _3 = Droppy(const 0usize,);      // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+        _3 = Droppy(const 0usize);       // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-        _2 = Aligned(move _3,);          // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+        _2 = Aligned(move _3);           // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
         StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
-        _1 = Packed(move _2,);           // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
+        _1 = Packed(move _2);            // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
         StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
         StorageLive(_4);                 // bb0[8]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
         StorageLive(_5);                 // bb0[9]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
-        _5 = Droppy(const 0usize,);      // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+        _5 = Droppy(const 0usize);       // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-        _4 = Aligned(move _5,);          // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+        _4 = Aligned(move _5);           // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
         StorageDead(_5);                 // bb0[12]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
         StorageLive(_6);                 // bb0[13]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
         _6 = move (_1.0: Aligned);       // bb0[14]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
diff --git a/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
index 727c271a478..125f69b0bc2 100644
--- a/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
@@ -67,7 +67,7 @@ fn main() -> () {
         StorageLive(_3);                 // bb0[3]: scope 1 at $DIR/retag.rs:32:13: 32:14
         StorageLive(_4);                 // bb0[4]: scope 1 at $DIR/retag.rs:32:17: 32:24
         StorageLive(_5);                 // bb0[5]: scope 1 at $DIR/retag.rs:32:17: 32:24
-        _5 = Test(const 0i32,);          // bb0[6]: scope 1 at $DIR/retag.rs:32:17: 32:24
+        _5 = Test(const 0i32);           // bb0[6]: scope 1 at $DIR/retag.rs:32:17: 32:24
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
@@ -170,7 +170,7 @@ fn main() -> () {
         StorageLive(_19);                // bb5[4]: scope 7 at $DIR/retag.rs:47:5: 47:24
         StorageLive(_20);                // bb5[5]: scope 7 at $DIR/retag.rs:47:5: 47:12
         StorageLive(_21);                // bb5[6]: scope 7 at $DIR/retag.rs:47:5: 47:12
-        _21 = Test(const 0i32,);         // bb5[7]: scope 7 at $DIR/retag.rs:47:5: 47:12
+        _21 = Test(const 0i32);          // bb5[7]: scope 7 at $DIR/retag.rs:47:5: 47:12
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
diff --git a/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir b/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir
index e455a27642d..799521b09a6 100644
--- a/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir
+++ b/src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir
@@ -50,7 +50,7 @@ fn main() -> () {
         StorageLive(_4);                 // bb0[5]: scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
         StorageLive(_5);                 // bb0[6]: scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
         _5 = _1;                         // bb0[7]: scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
-        _4 = std::option::Option::<i32>::Some(move _5,); // bb0[8]: scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
+        _4 = std::option::Option::<i32>::Some(move _5); // bb0[8]: scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
         StorageDead(_5);                 // bb0[9]: scope 1 at $DIR/storage_ranges.rs:6:24: 6:25
         _3 = &_4;                        // bb0[10]: scope 1 at $DIR/storage_ranges.rs:6:17: 6:25
         FakeRead(ForLet, _3);            // bb0[11]: scope 1 at $DIR/storage_ranges.rs:6:13: 6:14