Skip to content

Commit

Permalink
Fix UB in the test case
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Feb 12, 2023
1 parent 640ede7 commit d8d18aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/mir-opt/copy-prop/custom_move_arg.f.CopyProp.diff
Original file line number Diff line number Diff line change
Expand Up @@ -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>) }
Expand Down
2 changes: 1 addition & 1 deletion tests/mir-opt/copy-prop/custom_move_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit d8d18aa

Please sign in to comment.