Fix UB in the test case

This commit is contained in:
Ben Kimock 2023-02-12 14:42:16 -05:00
parent 640ede7b0a
commit d8d18aae03
2 changed files with 4 additions and 3 deletions

View File

@ -7,8 +7,9 @@
let mut _3: NotCopy; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL let mut _3: NotCopy; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
bb0: { bb0: {
- _2 = move _1; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL - _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>(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 // mir::Constant
// + span: $DIR/custom_move_arg.rs:15:24: 15:30 // + span: $DIR/custom_move_arg.rs:15:24: 15:30
// + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) } // + literal: Const { ty: fn(NotCopy) {opaque::<NotCopy>}, val: Value(<ZST>) }

View File

@ -11,7 +11,7 @@
#[custom_mir(dialect = "analysis", phase = "post-cleanup")] #[custom_mir(dialect = "analysis", phase = "post-cleanup")]
fn f(_1: NotCopy) { fn f(_1: NotCopy) {
mir!({ mir!({
let _2 = Move(_1); let _2 = _1;
Call(RET, bb1, opaque(Move(_1))) Call(RET, bb1, opaque(Move(_1)))
} }
bb1 = { bb1 = {