Skip to content

Commit d8d18aa

Browse files
committed
Fix UB in the test case
1 parent 640ede7 commit d8d18aa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
let mut _3: NotCopy; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
88

99
bb0: {
10-
- _2 = move _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
11-
_0 = opaque::<NotCopy>(move _1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
10+
- _2 = _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
11+
- _0 = opaque::<NotCopy>(move _1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
12+
+ _0 = opaque::<NotCopy>(_1) -> bb1; // scope 0 at $DIR/custom_move_arg.rs:+3:9: +3:41
1213
// mir::Constant
1314
// + span: $DIR/custom_move_arg.rs:15:24: 15:30
1415
// + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }

tests/mir-opt/copy-prop/custom_move_arg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct NotCopy(bool);
1111
#[custom_mir(dialect = "analysis", phase = "post-cleanup")]
1212
fn f(_1: NotCopy) {
1313
mir!({
14-
let _2 = Move(_1);
14+
let _2 = _1;
1515
Call(RET, bb1, opaque(Move(_1)))
1616
}
1717
bb1 = {

0 commit comments

Comments
 (0)