about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2023-02-12 14:42:16 -0500
committerBen Kimock <kimockb@gmail.com>2023-02-12 14:42:16 -0500
commitd8d18aae03896b66959fddbce58186904eb9ce04 (patch)
treeb9b842f02489dc5efc9200c62d41521e57c1c4b9
parent640ede7b0a1840415cb6ec881c2210302bfeba18 (diff)
downloadrust-d8d18aae03896b66959fddbce58186904eb9ce04.tar.gz
rust-d8d18aae03896b66959fddbce58186904eb9ce04.zip
Fix UB in the test case
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff5
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.rs2
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
index 8d5bd10b6cf..6ca73ffdde2 100644
--- a/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
+++ b/tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
@@ -7,8 +7,9 @@
       let mut _3: NotCopy;                 // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
   
       bb0: {
--         _2 = move _1;                    // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
-          _0 = opaque::<NotCopy>(move _1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
+-         _2 = _1;                         // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+-         _0 = opaque::<NotCopy>(move _1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
++         _0 = opaque::<NotCopy>(_1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
                                            // mir::Constant
                                            // + span: $DIR/custom_move_arg.rs:15:24: 15:30
                                            // + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.rs b/tests/mir-opt/copy-prop/custom_move_arg.rs
index 67911f0f59c..4a591146e61 100644
--- a/tests/mir-opt/copy-prop/custom_move_arg.rs
+++ b/tests/mir-opt/copy-prop/custom_move_arg.rs
@@ -11,7 +11,7 @@ struct NotCopy(bool);
 #[custom_mir(dialect = "analysis", phase = "post-cleanup")]
 fn f(_1: NotCopy) {
     mir!({
-        let _2 = Move(_1);
+        let _2 = _1;
         Call(RET, bb1, opaque(Move(_1)))
     }
     bb1 = {