about summary refs log tree commit diff
path: root/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-16 01:55:34 +0000
committerbors <bors@rust-lang.org>2023-06-16 01:55:34 +0000
commitc84d5e7078435a0ddd8770c3530fe7fdbf026ec4 (patch)
tree5db6de1bd9e77cdd8fd93debe36d363dc1ec391e /tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
parent0252b4093ff19a8aaae2a1965b76b9ba4528e5c0 (diff)
parent0a1fa411edbf6f9ad1205655d77cfda5a43aac06 (diff)
downloadrust-c84d5e7078435a0ddd8770c3530fe7fdbf026ec4.tar.gz
rust-c84d5e7078435a0ddd8770c3530fe7fdbf026ec4.zip
Auto merge of #112346 - saethlin:no-comment, r=oli-obk
Remove comments from mir-opt MIR dumps

See https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Line.20numbers.20in.20mir-opt.20tests/near/363849874

In https://github.com/rust-lang/rust/pull/99780 there is mention that "there has been a zulip conversation about disabling line numbers with mixed opinions" which to me means that some people opposed this. I can't find the referenced conversation so... here we go.

The current situation is quite chaotic. It's not hard to find MIR diffs which contain

* Absolute line numbers
* Relative line numbers
* Substituted line numbers (LL)
For example: https://github.com/rust-lang/rust/blob/408bbd040613f6776e0a7d05d582c81f4ddc189a/tests/mir-opt/inline/inline_shims.drop.Inline.diff#L10-L17

And sometimes adding a comment at the top of a mir-opt test generates a diff in the test because a line number changed: https://github.com/rust-lang/rust/pull/98112/files#diff-b8cf4bcce95078e6a3faf075e9abf6864872fb28a64d95c04f04513b9e3bbd81

And irrelevant changes to the standard library can generate diffs in mir-opt tests: https://github.com/rust-lang/rust/pull/110694/files#diff-bf96b0e7c67b8b272814536888fd9428c314991e155beae1f0a2a67f0ac47b2c
https://github.com/rust-lang/rust/commit/769886cc35ce08b76839f4cf72b8af1161c432e1

I think we should, specifically in mir-opt tests, completely remove the comments, or insert placeholders for all line and column numbers.
Diffstat (limited to 'tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff')
-rw-r--r--tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff b/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
index bd010e7b160..ad8d9ddb074 100644
--- a/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/mutable_variable.main.ConstProp.diff
@@ -2,27 +2,27 @@
 + // MIR for `main` after ConstProp
   
   fn main() -> () {
-      let mut _0: ();                      // return place in scope 0 at $DIR/mutable_variable.rs:+0:11: +0:11
-      let mut _1: i32;                     // in scope 0 at $DIR/mutable_variable.rs:+1:9: +1:14
+      let mut _0: ();
+      let mut _1: i32;
       scope 1 {
-          debug x => _1;                   // in scope 1 at $DIR/mutable_variable.rs:+1:9: +1:14
-          let _2: i32;                     // in scope 1 at $DIR/mutable_variable.rs:+3:9: +3:10
+          debug x => _1;
+          let _2: i32;
           scope 2 {
-              debug y => _2;               // in scope 2 at $DIR/mutable_variable.rs:+3:9: +3:10
+              debug y => _2;
           }
       }
   
       bb0: {
-          StorageLive(_1);                 // scope 0 at $DIR/mutable_variable.rs:+1:9: +1:14
-          _1 = const 42_i32;               // scope 0 at $DIR/mutable_variable.rs:+1:17: +1:19
-          _1 = const 99_i32;               // scope 1 at $DIR/mutable_variable.rs:+2:5: +2:11
-          StorageLive(_2);                 // scope 1 at $DIR/mutable_variable.rs:+3:9: +3:10
--         _2 = _1;                         // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
-+         _2 = const 99_i32;               // scope 1 at $DIR/mutable_variable.rs:+3:13: +3:14
-          _0 = const ();                   // scope 0 at $DIR/mutable_variable.rs:+0:11: +4:2
-          StorageDead(_2);                 // scope 1 at $DIR/mutable_variable.rs:+4:1: +4:2
-          StorageDead(_1);                 // scope 0 at $DIR/mutable_variable.rs:+4:1: +4:2
-          return;                          // scope 0 at $DIR/mutable_variable.rs:+4:2: +4:2
+          StorageLive(_1);
+          _1 = const 42_i32;
+          _1 = const 99_i32;
+          StorageLive(_2);
+-         _2 = _1;
++         _2 = const 99_i32;
+          _0 = const ();
+          StorageDead(_2);
+          StorageDead(_1);
+          return;
       }
   }