about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJakob Degen <jakob.e.degen@gmail.com>2022-11-27 21:23:39 -0800
committerJakob Degen <jakob.e.degen@gmail.com>2022-11-29 19:27:26 -0800
commit5a34dbf193ac8cfb7dbe53b354614f2622f5682c (patch)
treeedf85bf3d6fc29aa4277c00594ca0c4772a5ab54 /src/test
parent52ce1f7697924685ca7abf09be540bb21df46104 (diff)
Improve spans in custom mir
Diffstat (limited to 'src/test')
-rw-r--r--src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir12
-rw-r--r--src/test/mir-opt/building/custom/consts.consts.built.after.mir14
-rw-r--r--src/test/mir-opt/building/custom/consts.statics.built.after.mir8
-rw-r--r--src/test/mir-opt/building/custom/references.immut_ref.built.after.mir10
-rw-r--r--src/test/mir-opt/building/custom/references.mut_ref.built.after.mir10
-rw-r--r--src/test/mir-opt/building/custom/simple_assign.simple.built.after.mir10
-rw-r--r--src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir4
7 files changed, 34 insertions, 34 deletions
diff --git a/src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir b/src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
index d8cef6244f4..20dd251e7e3 100644
--- a/src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
+++ b/src/test/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
@@ -6,17 +6,17 @@ fn arbitrary_let(_1: i32) -> i32 {
     let mut _3: i32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
 
     bb0: {
-        _2 = _1;                         // scope 0 at $DIR/arbitrary_let.rs:+0:1: +0:32
-        goto -> bb2;                     // scope 0 at $DIR/arbitrary_let.rs:+0:1: +0:32
+        _2 = _1;                         // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+        goto -> bb2;                     // scope 0 at $DIR/arbitrary_let.rs:+4:13: +4:25
     }
 
     bb1: {
-        _0 = _3;                         // scope 0 at $DIR/arbitrary_let.rs:+0:1: +0:32
-        return;                          // scope 0 at $DIR/arbitrary_let.rs:+0:1: +0:32
+        _0 = _3;                         // scope 0 at $DIR/arbitrary_let.rs:+7:13: +7:20
+        return;                          // scope 0 at $DIR/arbitrary_let.rs:+8:13: +8:21
     }
 
     bb2: {
-        _3 = _2;                         // scope 0 at $DIR/arbitrary_let.rs:+0:1: +0:32
-        goto -> bb1;                     // scope 0 at $DIR/arbitrary_let.rs:+0:1: +0:32
+        _3 = _2;                         // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+        goto -> bb1;                     // scope 0 at $DIR/arbitrary_let.rs:+12:13: +12:24
     }
 }
diff --git a/src/test/mir-opt/building/custom/consts.consts.built.after.mir b/src/test/mir-opt/building/custom/consts.consts.built.after.mir
index e384cdeb465..ba753cfc20c 100644
--- a/src/test/mir-opt/building/custom/consts.consts.built.after.mir
+++ b/src/test/mir-opt/building/custom/consts.consts.built.after.mir
@@ -1,7 +1,7 @@
 // MIR for `consts` after built
 
 fn consts() -> () {
-    let mut _0: ();                      // return place in scope 0 at $DIR/consts.rs:10:27: 10:27
+    let mut _0: ();                      // return place in scope 0 at $DIR/consts.rs:+0:27: +0:27
     let mut _1: u8;                      // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
     let mut _2: i8;                      // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
     let mut _3: u32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
@@ -9,14 +9,14 @@ fn consts() -> () {
     let mut _5: fn() {consts::<10>};     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
 
     bb0: {
-        _1 = const 5_u8;                 // scope 0 at $DIR/consts.rs:+0:1: +0:26
-        _2 = const _;                    // scope 0 at $DIR/consts.rs:+0:1: +0:26
-        _3 = const C;                    // scope 0 at $DIR/consts.rs:+0:1: +0:26
-        _4 = const _;                    // scope 0 at $DIR/consts.rs:+0:1: +0:26
-        _5 = consts::<10>;               // scope 0 at $DIR/consts.rs:+0:1: +0:26
+        _1 = const 5_u8;                 // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+        _2 = const _;                    // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+        _3 = const C;                    // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+        _4 = const _;                    // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+        _5 = consts::<10>;               // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
                                          // mir::Constant
                                          // + span: $DIR/consts.rs:16:18: 16:30
                                          // + literal: Const { ty: fn() {consts::<10>}, val: Value(<ZST>) }
-        return;                          // scope 0 at $DIR/consts.rs:+0:1: +0:26
+        return;                          // scope 0 at $DIR/consts.rs:+7:9: +7:17
     }
 }
diff --git a/src/test/mir-opt/building/custom/consts.statics.built.after.mir b/src/test/mir-opt/building/custom/consts.statics.built.after.mir
index a193af729d5..ee768e263ec 100644
--- a/src/test/mir-opt/building/custom/consts.statics.built.after.mir
+++ b/src/test/mir-opt/building/custom/consts.statics.built.after.mir
@@ -1,20 +1,20 @@
 // MIR for `statics` after built
 
 fn statics() -> () {
-    let mut _0: ();                      // return place in scope 0 at $DIR/consts.rs:25:14: 25:14
+    let mut _0: ();                      // return place in scope 0 at $DIR/consts.rs:+0:14: +0:14
     let mut _1: &i32;                    // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
     let mut _2: *mut i32;                // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
 
     bb0: {
-        _1 = const {alloc1: &i32};       // scope 0 at $DIR/consts.rs:+0:1: +0:13
+        _1 = const {alloc1: &i32};       // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
                                          // mir::Constant
                                          // + span: $DIR/consts.rs:27:31: 27:32
                                          // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
-        _2 = const {alloc2: *mut i32};   // scope 0 at $DIR/consts.rs:+0:1: +0:13
+        _2 = const {alloc2: *mut i32};   // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
                                          // mir::Constant
                                          // + span: $DIR/consts.rs:28:38: 28:39
                                          // + literal: Const { ty: *mut i32, val: Value(Scalar(alloc2)) }
-        return;                          // scope 0 at $DIR/consts.rs:+0:1: +0:13
+        return;                          // scope 0 at $DIR/consts.rs:+4:9: +4:17
     }
 }
 
diff --git a/src/test/mir-opt/building/custom/references.immut_ref.built.after.mir b/src/test/mir-opt/building/custom/references.immut_ref.built.after.mir
index 4a5ddde4081..4d38d45c0f4 100644
--- a/src/test/mir-opt/building/custom/references.immut_ref.built.after.mir
+++ b/src/test/mir-opt/building/custom/references.immut_ref.built.after.mir
@@ -5,10 +5,10 @@ fn immut_ref(_1: &i32) -> &i32 {
     let mut _2: *const i32;              // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
 
     bb0: {
-        _2 = &raw const (*_1);           // scope 0 at $DIR/references.rs:+0:1: +0:34
-        Retag([raw] _2);                 // scope 0 at $DIR/references.rs:+0:1: +0:34
-        _0 = &(*_2);                     // scope 0 at $DIR/references.rs:+0:1: +0:34
-        Retag(_0);                       // scope 0 at $DIR/references.rs:+0:1: +0:34
-        return;                          // scope 0 at $DIR/references.rs:+0:1: +0:34
+        _2 = &raw const (*_1);           // scope 0 at $DIR/references.rs:+5:13: +5:29
+        Retag([raw] _2);                 // scope 0 at $DIR/references.rs:+6:13: +6:24
+        _0 = &(*_2);                     // scope 0 at $DIR/references.rs:+7:13: +7:23
+        Retag(_0);                       // scope 0 at $DIR/references.rs:+8:13: +8:23
+        return;                          // scope 0 at $DIR/references.rs:+9:13: +9:21
     }
 }
diff --git a/src/test/mir-opt/building/custom/references.mut_ref.built.after.mir b/src/test/mir-opt/building/custom/references.mut_ref.built.after.mir
index ec8509f69d1..01bc8a9cd35 100644
--- a/src/test/mir-opt/building/custom/references.mut_ref.built.after.mir
+++ b/src/test/mir-opt/building/custom/references.mut_ref.built.after.mir
@@ -5,10 +5,10 @@ fn mut_ref(_1: &mut i32) -> &mut i32 {
     let mut _2: *mut i32;                // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
 
     bb0: {
-        _2 = &raw mut (*_1);             // scope 0 at $DIR/references.rs:+0:1: +0:40
-        Retag([raw] _2);                 // scope 0 at $DIR/references.rs:+0:1: +0:40
-        _0 = &mut (*_2);                 // scope 0 at $DIR/references.rs:+0:1: +0:40
-        Retag(_0);                       // scope 0 at $DIR/references.rs:+0:1: +0:40
-        return;                          // scope 0 at $DIR/references.rs:+0:1: +0:40
+        _2 = &raw mut (*_1);             // scope 0 at $DIR/references.rs:+5:13: +5:33
+        Retag([raw] _2);                 // scope 0 at $DIR/references.rs:+6:13: +6:24
+        _0 = &mut (*_2);                 // scope 0 at $DIR/references.rs:+7:13: +7:26
+        Retag(_0);                       // scope 0 at $DIR/references.rs:+8:13: +8:23
+        return;                          // scope 0 at $DIR/references.rs:+9:13: +9:21
     }
 }
diff --git a/src/test/mir-opt/building/custom/simple_assign.simple.built.after.mir b/src/test/mir-opt/building/custom/simple_assign.simple.built.after.mir
index a5a2834c2e1..d7560fde69c 100644
--- a/src/test/mir-opt/building/custom/simple_assign.simple.built.after.mir
+++ b/src/test/mir-opt/building/custom/simple_assign.simple.built.after.mir
@@ -6,13 +6,13 @@ fn simple(_1: i32) -> i32 {
     let mut _3: i32;                     // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
 
     bb0: {
-        _2 = _1;                         // scope 0 at $DIR/simple_assign.rs:+0:1: +0:29
-        goto -> bb1;                     // scope 0 at $DIR/simple_assign.rs:+0:1: +0:29
+        _2 = _1;                         // scope 0 at $DIR/simple_assign.rs:+6:13: +6:22
+        goto -> bb1;                     // scope 0 at $DIR/simple_assign.rs:+7:13: +7:23
     }
 
     bb1: {
-        _3 = move _2;                    // scope 0 at $DIR/simple_assign.rs:+0:1: +0:29
-        _0 = _3;                         // scope 0 at $DIR/simple_assign.rs:+0:1: +0:29
-        return;                          // scope 0 at $DIR/simple_assign.rs:+0:1: +0:29
+        _3 = move _2;                    // scope 0 at $DIR/simple_assign.rs:+11:13: +11:32
+        _0 = _3;                         // scope 0 at $DIR/simple_assign.rs:+12:13: +12:24
+        return;                          // scope 0 at $DIR/simple_assign.rs:+13:13: +13:21
     }
 }
diff --git a/src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir b/src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
index 6c90f0130a2..2b0e8f1047b 100644
--- a/src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
+++ b/src/test/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
@@ -4,7 +4,7 @@ fn simple_ref(_1: &mut i32) -> &mut i32 {
     let mut _0: &mut i32;                // return place in scope 0 at $DIR/simple_assign.rs:+0:35: +0:43
 
     bb0: {
-        _0 = move _1;                    // scope 0 at $DIR/simple_assign.rs:+0:1: +0:43
-        return;                          // scope 0 at $DIR/simple_assign.rs:+0:1: +0:43
+        _0 = move _1;                    // scope 0 at $DIR/simple_assign.rs:+2:9: +2:22
+        return;                          // scope 0 at $DIR/simple_assign.rs:+3:9: +3:17
     }
 }