summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/building
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mir-opt/building')
-rw-r--r--tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir28
-rw-r--r--tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir388
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir18
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir16
-rw-r--r--tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir18
-rw-r--r--tests/mir-opt/building/custom/arrays.arrays.built.after.mir14
-rw-r--r--tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/composite_return.tuple.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/consts.consts.built.after.mir27
-rw-r--r--tests/mir-opt/building/custom/consts.statics.built.after.mir18
-rw-r--r--tests/mir-opt/building/custom/enums.set_discr.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/enums.switch_bool.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/enums.switch_option.built.after.mir16
-rw-r--r--tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir16
-rw-r--r--tests/mir-opt/building/custom/operators.f.built.after.mir46
-rw-r--r--tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir10
-rw-r--r--tests/mir-opt/building/custom/projections.set.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/projections.simple_index.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/projections.tuples.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/projections.unions.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/projections.unwrap.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/references.immut_ref.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/references.mut_ref.built.after.mir12
-rw-r--r--tests/mir-opt/building/custom/references.raw_pointer.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/simple_assign.simple.built.after.mir20
-rw-r--r--tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/terminators.direct_call.built.after.mir9
-rw-r--r--tests/mir-opt/building/custom/terminators.drop_first.built.after.mir8
-rw-r--r--tests/mir-opt/building/custom/terminators.drop_second.built.after.mir6
-rw-r--r--tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir6
-rw-r--r--tests/mir-opt/building/enum_cast.bar.built.after.mir30
-rw-r--r--tests/mir-opt/building/enum_cast.boo.built.after.mir30
-rw-r--r--tests/mir-opt/building/enum_cast.droppy.built.after.mir82
-rw-r--r--tests/mir-opt/building/enum_cast.far.built.after.mir30
-rw-r--r--tests/mir-opt/building/enum_cast.foo.built.after.mir20
-rw-r--r--tests/mir-opt/building/enum_cast.offsetty.built.after.mir38
-rw-r--r--tests/mir-opt/building/enum_cast.signy.built.after.mir38
-rw-r--r--tests/mir-opt/building/enum_cast.unsigny.built.after.mir20
-rw-r--r--tests/mir-opt/building/issue_101867.main.built.after.mir72
-rw-r--r--tests/mir-opt/building/issue_110508.rs13
-rw-r--r--tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir14
-rw-r--r--tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir14
-rw-r--r--tests/mir-opt/building/issue_49232.main.built.after.mir77
-rw-r--r--tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir125
-rw-r--r--tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir125
-rw-r--r--tests/mir-opt/building/match_false_edges.main.built.after.mir190
-rw-r--r--tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir125
-rw-r--r--tests/mir-opt/building/shifts.shift_signed.built.after.mir238
-rw-r--r--tests/mir-opt/building/shifts.shift_unsigned.built.after.mir214
-rw-r--r--tests/mir-opt/building/simple_match.match_bool.built.after.mir20
-rw-r--r--tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir389
-rw-r--r--tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir116
-rw-r--r--tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir116
60 files changed, 1456 insertions, 1496 deletions
diff --git a/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir
index accb504c0..074ebddf7 100644
--- a/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir
+++ b/tests/mir-opt/building/async_await.a-{closure#0}.generator_resume.0.mir
@@ -10,30 +10,30 @@
} */
fn a::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:11:14: 11:16]>, _2: &mut Context<'_>) -> Poll<()> {
- debug _task_context => _4; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _0: std::task::Poll<()>; // return place in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _3: (); // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _4: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
- let mut _5: u32; // in scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ debug _task_context => _4;
+ let mut _0: std::task::Poll<()>;
+ let mut _3: ();
+ let mut _4: &mut std::task::Context<'_>;
+ let mut _5: u32;
bb0: {
- _5 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))); // scope 0 at $DIR/async_await.rs:+0:14: +0:16
- switchInt(move _5) -> [0: bb1, 1: bb2, otherwise: bb3]; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ _5 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16])));
+ switchInt(move _5) -> [0: bb1, 1: bb2, otherwise: bb3];
}
bb1: {
- _4 = move _2; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
- _3 = const (); // scope 0 at $DIR/async_await.rs:+0:14: +0:16
- _0 = Poll::<()>::Ready(move _3); // scope 0 at $DIR/async_await.rs:+0:16: +0:16
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))) = 1; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
- return; // scope 0 at $DIR/async_await.rs:+0:16: +0:16
+ _4 = move _2;
+ _3 = const ();
+ _0 = Poll::<()>::Ready(move _3);
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:11:14: 11:16]))) = 1;
+ return;
}
bb2: {
- assert(const false, "`async fn` resumed after completion") -> bb2; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ assert(const false, "`async fn` resumed after completion") -> [success: bb2, unwind continue];
}
bb3: {
- unreachable; // scope 0 at $DIR/async_await.rs:+0:14: +0:16
+ unreachable;
}
}
diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
index a9d1477b9..f774f32eb 100644
--- a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
+++ b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
@@ -32,312 +32,288 @@
} */
fn b::{closure#0}(_1: Pin<&mut [async fn body@$DIR/async_await.rs:14:18: 17:2]>, _2: &mut Context<'_>) -> Poll<()> {
- debug _task_context => _38; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let mut _0: std::task::Poll<()>; // return place in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let _3: (); // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _4: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _5: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:8
- let mut _6: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _7: (); // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let _8: (); // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _9: std::task::Poll<()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _10: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _11: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _12: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _13: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _14: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _15: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _16: isize; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _18: !; // in scope 0 at $DIR/async_await.rs:+1:5: +1:14
- let mut _19: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _20: (); // in scope 0 at $DIR/async_await.rs:+1:9: +1:14
- let mut _21: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _22: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:8
- let mut _23: impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let _24: (); // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _25: std::task::Poll<()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _26: std::pin::Pin<&mut impl std::future::Future<Output = ()>>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _27: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _28: &mut impl std::future::Future<Output = ()>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _29: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14
- let mut _30: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14
- let mut _31: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _32: isize; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _34: !; // in scope 0 at $DIR/async_await.rs:+2:5: +2:14
- let mut _35: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _36: (); // in scope 0 at $DIR/async_await.rs:+2:9: +2:14
- let mut _37: (); // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let mut _38: &mut std::task::Context<'_>; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
- let mut _39: u32; // in scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ debug _task_context => _38;
+ let mut _0: std::task::Poll<()>;
+ let _3: ();
+ let mut _4: impl std::future::Future<Output = ()>;
+ let mut _5: impl std::future::Future<Output = ()>;
+ let mut _6: impl std::future::Future<Output = ()>;
+ let mut _7: ();
+ let _8: ();
+ let mut _9: std::task::Poll<()>;
+ let mut _10: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
+ let mut _11: &mut impl std::future::Future<Output = ()>;
+ let mut _12: &mut impl std::future::Future<Output = ()>;
+ let mut _13: &mut std::task::Context<'_>;
+ let mut _14: &mut std::task::Context<'_>;
+ let mut _15: &mut std::task::Context<'_>;
+ let mut _16: isize;
+ let mut _18: !;
+ let mut _19: &mut std::task::Context<'_>;
+ let mut _20: ();
+ let mut _21: impl std::future::Future<Output = ()>;
+ let mut _22: impl std::future::Future<Output = ()>;
+ let mut _23: impl std::future::Future<Output = ()>;
+ let _24: ();
+ let mut _25: std::task::Poll<()>;
+ let mut _26: std::pin::Pin<&mut impl std::future::Future<Output = ()>>;
+ let mut _27: &mut impl std::future::Future<Output = ()>;
+ let mut _28: &mut impl std::future::Future<Output = ()>;
+ let mut _29: &mut std::task::Context<'_>;
+ let mut _30: &mut std::task::Context<'_>;
+ let mut _31: &mut std::task::Context<'_>;
+ let mut _32: isize;
+ let mut _34: !;
+ let mut _35: &mut std::task::Context<'_>;
+ let mut _36: ();
+ let mut _37: ();
+ let mut _38: &mut std::task::Context<'_>;
+ let mut _39: u32;
scope 1 {
- debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>); // in scope 1 at $DIR/async_await.rs:+1:9: +1:14
- let _17: (); // in scope 1 at $DIR/async_await.rs:+1:5: +1:14
+ debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>);
+ let _17: ();
scope 2 {
}
scope 3 {
- debug result => _17; // in scope 3 at $DIR/async_await.rs:+1:5: +1:14
+ debug result => _17;
}
}
scope 4 {
- debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>); // in scope 4 at $DIR/async_await.rs:+2:9: +2:14
- let _33: (); // in scope 4 at $DIR/async_await.rs:+2:5: +2:14
+ debug __awaitee => (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>);
+ let _33: ();
scope 5 {
}
scope 6 {
- debug result => _33; // in scope 6 at $DIR/async_await.rs:+2:5: +2:14
+ debug result => _33;
}
}
bb0: {
- _39 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- switchInt(move _39) -> [0: bb1, 1: bb28, 3: bb26, 4: bb27, otherwise: bb29]; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ _39 = discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])));
+ switchInt(move _39) -> [0: bb1, 1: bb28, 3: bb26, 4: bb27, otherwise: bb29];
}
bb1: {
- _38 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_3); // scope 0 at $DIR/async_await.rs:+1:5: +1:14
- StorageLive(_4); // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_5); // scope 0 at $DIR/async_await.rs:+1:5: +1:8
- _5 = a() -> [return: bb2, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+1:5: +1:8
- // mir::Constant
- // + span: $DIR/async_await.rs:15:5: 15:6
- // + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) }
+ _38 = move _2;
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ _5 = a() -> [return: bb2, unwind unreachable];
}
bb2: {
- _4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- // mir::Constant
- // + span: $DIR/async_await.rs:15:9: 15:14
- // + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) }
+ _4 = <impl Future<Output = ()> as IntoFuture>::into_future(move _5) -> [return: bb3, unwind unreachable];
}
bb3: {
- StorageDead(_5); // scope 0 at $DIR/async_await.rs:+1:13: +1:14
- nop; // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>) = move _4; // scope 0 at $DIR/async_await.rs:+1:9: +1:14
- goto -> bb4; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ StorageDead(_5);
+ nop;
+ (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>) = move _4;
+ goto -> bb4;
}
bb4: {
- StorageLive(_8); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_9); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_10); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_11); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_12); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _12 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _11 = &mut (*_12); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> [return: bb5, unwind unreachable]; // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- // mir::Constant
- // + span: $DIR/async_await.rs:15:9: 15:14
- // + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) }
+ StorageLive(_8);
+ StorageLive(_9);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#3).0: impl std::future::Future<Output = ()>);
+ _11 = &mut (*_12);
+ _10 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _11) -> [return: bb5, unwind unreachable];
}
bb5: {
- StorageDead(_11); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- StorageLive(_13); // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- StorageLive(_14); // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- StorageLive(_15); // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _15 = _38; // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- _14 = move _15; // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- goto -> bb6; // scope 2 at $DIR/async_await.rs:+1:5: +1:14
+ StorageDead(_11);
+ StorageLive(_13);
+ StorageLive(_14);
+ StorageLive(_15);
+ _15 = _38;
+ _14 = move _15;
+ goto -> bb6;
}
bb6: {
- _13 = &mut (*_14); // scope 2 at $DIR/async_await.rs:+1:5: +1:14
- StorageDead(_15); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- _9 = <impl Future<Output = ()> as Future>::poll(move _10, move _13) -> [return: bb7, unwind unreachable]; // scope 2 at $DIR/async_await.rs:+1:9: +1:14
- // mir::Constant
- // + span: $DIR/async_await.rs:15:9: 15:14
- // + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) }
+ _13 = &mut (*_14);
+ StorageDead(_15);
+ _9 = <impl Future<Output = ()> as Future>::poll(move _10, move _13) -> [return: bb7, unwind unreachable];
}
bb7: {
- StorageDead(_13); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_10); // scope 2 at $DIR/async_await.rs:+1:13: +1:14
- _16 = discriminant(_9); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- switchInt(move _16) -> [0: bb10, 1: bb8, otherwise: bb9]; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ StorageDead(_13);
+ StorageDead(_10);
+ _16 = discriminant(_9);
+ switchInt(move _16) -> [0: bb10, 1: bb8, otherwise: bb9];
}
bb8: {
- _8 = const (); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageDead(_14); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_12); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_9); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_8); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageLive(_19); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageLive(_20); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- _20 = (); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- _0 = Poll::<()>::Pending; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 3; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- return; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ _8 = const ();
+ StorageDead(_14);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_19);
+ StorageLive(_20);
+ _20 = ();
+ _0 = Poll::<()>::Pending;
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 3;
+ return;
}
bb9: {
- unreachable; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ unreachable;
}
bb10: {
- StorageLive(_17); // scope 1 at $DIR/async_await.rs:+1:5: +1:14
- _17 = ((_9 as Ready).0: ()); // scope 1 at $DIR/async_await.rs:+1:5: +1:14
- _3 = _17; // scope 3 at $DIR/async_await.rs:+1:5: +1:14
- StorageDead(_17); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_14); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_12); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_9); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- StorageDead(_8); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- goto -> bb12; // scope 0 at $DIR/async_await.rs:+1:13: +1:14
+ StorageLive(_17);
+ _17 = ((_9 as Ready).0: ());
+ _3 = _17;
+ StorageDead(_17);
+ StorageDead(_14);
+ StorageDead(_12);
+ StorageDead(_9);
+ StorageDead(_8);
+ goto -> bb12;
}
bb11: {
- StorageDead(_20); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- _38 = move _19; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- StorageDead(_19); // scope 1 at $DIR/async_await.rs:+1:13: +1:14
- _7 = const (); // scope 1 at $DIR/async_await.rs:+1:9: +1:14
- goto -> bb4; // scope 1 at $DIR/async_await.rs:+1:9: +1:14
+ StorageDead(_20);
+ _38 = move _19;
+ StorageDead(_19);
+ _7 = const ();
+ goto -> bb4;
}
bb12: {
- nop; // scope 0 at $DIR/async_await.rs:+1:13: +1:14
- goto -> bb13; // scope 0 at $DIR/async_await.rs:+1:14: +1:15
+ nop;
+ goto -> bb13;
}
bb13: {
- StorageDead(_4); // scope 0 at $DIR/async_await.rs:+1:14: +1:15
- StorageDead(_3); // scope 0 at $DIR/async_await.rs:+1:14: +1:15
- StorageLive(_21); // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_22); // scope 0 at $DIR/async_await.rs:+2:5: +2:8
- _22 = a() -> [return: bb14, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+2:5: +2:8
- // mir::Constant
- // + span: $DIR/async_await.rs:16:5: 16:6
- // + literal: Const { ty: fn() -> impl Future<Output = ()> {a}, val: Value(<ZST>) }
+ StorageDead(_4);
+ StorageDead(_3);
+ StorageLive(_21);
+ StorageLive(_22);
+ _22 = a() -> [return: bb14, unwind unreachable];
}
bb14: {
- _21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable]; // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- // mir::Constant
- // + span: $DIR/async_await.rs:16:9: 16:14
- // + literal: Const { ty: fn(impl Future<Output = ()>) -> <impl Future<Output = ()> as IntoFuture>::IntoFuture {<impl Future<Output = ()> as IntoFuture>::into_future}, val: Value(<ZST>) }
+ _21 = <impl Future<Output = ()> as IntoFuture>::into_future(move _22) -> [return: bb15, unwind unreachable];
}
bb15: {
- StorageDead(_22); // scope 0 at $DIR/async_await.rs:+2:13: +2:14
- nop; // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>) = move _21; // scope 0 at $DIR/async_await.rs:+2:9: +2:14
- goto -> bb16; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ StorageDead(_22);
+ nop;
+ (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>) = move _21;
+ goto -> bb16;
}
bb16: {
- StorageLive(_24); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_25); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_26); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_27); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_28); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _28 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _27 = &mut (*_28); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> [return: bb17, unwind unreachable]; // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- // mir::Constant
- // + span: $DIR/async_await.rs:16:9: 16:14
- // + literal: Const { ty: unsafe fn(&mut impl Future<Output = ()>) -> Pin<&mut impl Future<Output = ()>> {Pin::<&mut impl Future<Output = ()>>::new_unchecked}, val: Value(<ZST>) }
+ StorageLive(_24);
+ StorageLive(_25);
+ StorageLive(_26);
+ StorageLive(_27);
+ StorageLive(_28);
+ _28 = &mut (((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2])) as variant#4).0: impl std::future::Future<Output = ()>);
+ _27 = &mut (*_28);
+ _26 = Pin::<&mut impl Future<Output = ()>>::new_unchecked(move _27) -> [return: bb17, unwind unreachable];
}
bb17: {
- StorageDead(_27); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- StorageLive(_29); // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- StorageLive(_30); // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- StorageLive(_31); // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _31 = _38; // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- _30 = move _31; // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- goto -> bb18; // scope 5 at $DIR/async_await.rs:+2:5: +2:14
+ StorageDead(_27);
+ StorageLive(_29);
+ StorageLive(_30);
+ StorageLive(_31);
+ _31 = _38;
+ _30 = move _31;
+ goto -> bb18;
}
bb18: {
- _29 = &mut (*_30); // scope 5 at $DIR/async_await.rs:+2:5: +2:14
- StorageDead(_31); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- _25 = <impl Future<Output = ()> as Future>::poll(move _26, move _29) -> [return: bb19, unwind unreachable]; // scope 5 at $DIR/async_await.rs:+2:9: +2:14
- // mir::Constant
- // + span: $DIR/async_await.rs:16:9: 16:14
- // + literal: Const { ty: for<'a, 'b, 'c> fn(Pin<&'a mut impl Future<Output = ()>>, &'b mut Context<'c>) -> Poll<<impl Future<Output = ()> as Future>::Output> {<impl Future<Output = ()> as Future>::poll}, val: Value(<ZST>) }
+ _29 = &mut (*_30);
+ StorageDead(_31);
+ _25 = <impl Future<Output = ()> as Future>::poll(move _26, move _29) -> [return: bb19, unwind unreachable];
}
bb19: {
- StorageDead(_29); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_26); // scope 5 at $DIR/async_await.rs:+2:13: +2:14
- _32 = discriminant(_25); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- switchInt(move _32) -> [0: bb21, 1: bb20, otherwise: bb9]; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ StorageDead(_29);
+ StorageDead(_26);
+ _32 = discriminant(_25);
+ switchInt(move _32) -> [0: bb21, 1: bb20, otherwise: bb9];
}
bb20: {
- _24 = const (); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageDead(_30); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_28); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_25); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_24); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageLive(_35); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageLive(_36); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- _36 = (); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- _0 = Poll::<()>::Pending; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 4; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- return; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ _24 = const ();
+ StorageDead(_30);
+ StorageDead(_28);
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageLive(_35);
+ StorageLive(_36);
+ _36 = ();
+ _0 = Poll::<()>::Pending;
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 4;
+ return;
}
bb21: {
- StorageLive(_33); // scope 4 at $DIR/async_await.rs:+2:5: +2:14
- _33 = ((_25 as Ready).0: ()); // scope 4 at $DIR/async_await.rs:+2:5: +2:14
- _37 = _33; // scope 6 at $DIR/async_await.rs:+2:5: +2:14
- StorageDead(_33); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_30); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_28); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_25); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- StorageDead(_24); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- goto -> bb23; // scope 0 at $DIR/async_await.rs:+2:13: +2:14
+ StorageLive(_33);
+ _33 = ((_25 as Ready).0: ());
+ _37 = _33;
+ StorageDead(_33);
+ StorageDead(_30);
+ StorageDead(_28);
+ StorageDead(_25);
+ StorageDead(_24);
+ goto -> bb23;
}
bb22: {
- StorageDead(_36); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- _38 = move _35; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- StorageDead(_35); // scope 4 at $DIR/async_await.rs:+2:13: +2:14
- _7 = const (); // scope 4 at $DIR/async_await.rs:+2:9: +2:14
- goto -> bb16; // scope 4 at $DIR/async_await.rs:+2:9: +2:14
+ StorageDead(_36);
+ _38 = move _35;
+ StorageDead(_35);
+ _7 = const ();
+ goto -> bb16;
}
bb23: {
- nop; // scope 0 at $DIR/async_await.rs:+2:13: +2:14
- goto -> bb24; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
+ nop;
+ goto -> bb24;
}
bb24: {
- StorageDead(_21); // scope 0 at $DIR/async_await.rs:+3:1: +3:2
- goto -> bb25; // scope 0 at $DIR/async_await.rs:+3:1: +3:2
+ StorageDead(_21);
+ goto -> bb25;
}
bb25: {
- _0 = Poll::<()>::Ready(move _37); // scope 0 at $DIR/async_await.rs:+3:2: +3:2
- discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 1; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
- return; // scope 0 at $DIR/async_await.rs:+3:2: +3:2
+ _0 = Poll::<()>::Ready(move _37);
+ discriminant((*(_1.0: &mut [async fn body@$DIR/async_await.rs:14:18: 17:2]))) = 1;
+ return;
}
bb26: {
- StorageLive(_3); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_4); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_19); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_20); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- _19 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- goto -> bb11; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_19);
+ StorageLive(_20);
+ _19 = move _2;
+ goto -> bb11;
}
bb27: {
- StorageLive(_21); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_35); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- StorageLive(_36); // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- _35 = move _2; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
- goto -> bb22; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ StorageLive(_21);
+ StorageLive(_35);
+ StorageLive(_36);
+ _35 = move _2;
+ goto -> bb22;
}
bb28: {
- assert(const false, "`async fn` resumed after completion") -> bb28; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ assert(const false, "`async fn` resumed after completion") -> [success: bb28, unwind continue];
}
bb29: {
- unreachable; // scope 0 at $DIR/async_await.rs:+0:18: +3:2
+ unreachable;
}
}
diff --git a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir
index 49e8c812c..c14882142 100644
--- a/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir
+++ b/tests/mir-opt/building/custom/aggregate_exprs.adt.built.after.mir
@@ -1,16 +1,16 @@
// MIR for `adt` after built
fn adt() -> Onion {
- let mut _0: Onion; // return place in scope 0 at $DIR/aggregate_exprs.rs:+0:13: +0:18
- let mut _1: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: Foo; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: Bar; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: Onion;
+ let mut _1: i32;
+ let mut _2: Foo;
+ let mut _3: Bar;
bb0: {
- _1 = const 1_i32; // scope 0 at $DIR/aggregate_exprs.rs:+6:13: +6:20
- _2 = Foo { a: const 1_i32, b: const 2_i32 }; // scope 0 at $DIR/aggregate_exprs.rs:+7:13: +10:14
- _3 = Bar::Foo(move _2, _1); // scope 0 at $DIR/aggregate_exprs.rs:+11:13: +11:39
- _0 = Onion { neon: ((_3 as variant#0).1: i32) }; // scope 0 at $DIR/aggregate_exprs.rs:+12:13: +12:58
- return; // scope 0 at $DIR/aggregate_exprs.rs:+13:13: +13:21
+ _1 = const 1_i32;
+ _2 = Foo { a: const 1_i32, b: const 2_i32 };
+ _3 = Bar::Foo(move _2, _1);
+ _0 = Onion { neon: ((_3 as variant#0).1: i32) };
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir
index 30d128973..fde007aba 100644
--- a/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir
+++ b/tests/mir-opt/building/custom/aggregate_exprs.array.built.after.mir
@@ -1,15 +1,15 @@
// MIR for `array` after built
fn array() -> [i32; 2] {
- let mut _0: [i32; 2]; // return place in scope 0 at $DIR/aggregate_exprs.rs:+0:15: +0:23
- let mut _1: [i32; 2]; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: [i32; 2];
+ let mut _1: [i32; 2];
+ let mut _2: i32;
bb0: {
- _1 = [const 42_i32, const 43_i32]; // scope 0 at $DIR/aggregate_exprs.rs:+5:13: +5:25
- _2 = const 1_i32; // scope 0 at $DIR/aggregate_exprs.rs:+6:13: +6:20
- _1 = [_2, const 2_i32]; // scope 0 at $DIR/aggregate_exprs.rs:+7:13: +7:25
- _0 = move _1; // scope 0 at $DIR/aggregate_exprs.rs:+8:13: +8:26
- return; // scope 0 at $DIR/aggregate_exprs.rs:+9:13: +9:21
+ _1 = [const 42_i32, const 43_i32];
+ _2 = const 1_i32;
+ _1 = [_2, const 2_i32];
+ _0 = move _1;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir b/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir
index 5fe45ccc9..060f72c9c 100644
--- a/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir
+++ b/tests/mir-opt/building/custom/aggregate_exprs.tuple.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `tuple` after built
fn tuple() -> (i32, bool) {
- let mut _0: (i32, bool); // return place in scope 0 at $DIR/aggregate_exprs.rs:+0:15: +0:26
+ let mut _0: (i32, bool);
bb0: {
- _0 = (const 1_i32, const true); // scope 0 at $DIR/aggregate_exprs.rs:+3:13: +3:28
- return; // scope 0 at $DIR/aggregate_exprs.rs:+4:13: +4:21
+ _0 = (const 1_i32, const true);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
index 20dd251e7..189996f11 100644
--- a/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
+++ b/tests/mir-opt/building/custom/arbitrary_let.arbitrary_let.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `arbitrary_let` after built
fn arbitrary_let(_1: i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/arbitrary_let.rs:+0:29: +0:32
- let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _2: i32;
+ let mut _3: i32;
bb0: {
- _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
+ _2 = _1;
+ goto -> bb2;
}
bb1: {
- _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
+ _0 = _3;
+ return;
}
bb2: {
- _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
+ _3 = _2;
+ goto -> bb1;
}
}
diff --git a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
index 4c9212728..eaeba302f 100644
--- a/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
+++ b/tests/mir-opt/building/custom/arrays.arrays.built.after.mir
@@ -1,14 +1,14 @@
// MIR for `arrays` after built
fn arrays() -> usize {
- let mut _0: usize; // return place in scope 0 at $DIR/arrays.rs:+0:32: +0:37
- let mut _1: [i32; C]; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: usize;
+ let mut _1: [i32; C];
+ let mut _2: usize;
bb0: {
- _1 = [const 5_i32; C]; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _2 = Len(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = _2; // scope 0 at $DIR/arrays.rs:+4:9: +4:16
- return; // scope 0 at $DIR/arrays.rs:+5:9: +5:17
+ _1 = [const 5_i32; C];
+ _2 = Len(_1);
+ _0 = _2;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir
index d0b770783..e3334bc7d 100644
--- a/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir
+++ b/tests/mir-opt/building/custom/as_cast.float_to_int.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `float_to_int` after built
fn float_to_int(_1: f32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/as_cast.rs:+0:28: +0:31
+ let mut _0: i32;
bb0: {
- _0 = _1 as i32 (FloatToInt); // scope 0 at $DIR/as_cast.rs:+3:13: +3:27
- return; // scope 0 at $DIR/as_cast.rs:+4:13: +4:21
+ _0 = _1 as i32 (FloatToInt);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir
index aaebff0d7..d71cb9d78 100644
--- a/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir
+++ b/tests/mir-opt/building/custom/as_cast.int_to_int.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `int_to_int` after built
fn int_to_int(_1: u32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/as_cast.rs:+0:26: +0:29
+ let mut _0: i32;
bb0: {
- _0 = _1 as i32 (IntToInt); // scope 0 at $DIR/as_cast.rs:+3:13: +3:27
- return; // scope 0 at $DIR/as_cast.rs:+4:13: +4:21
+ _0 = _1 as i32 (IntToInt);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir
index f040cf53d..0dc46d61e 100644
--- a/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir
+++ b/tests/mir-opt/building/custom/as_cast.int_to_ptr.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `int_to_ptr` after built
fn int_to_ptr(_1: usize) -> *const i32 {
- let mut _0: *const i32; // return place in scope 0 at $DIR/as_cast.rs:+0:28: +0:38
+ let mut _0: *const i32;
bb0: {
- _0 = _1 as *const i32 (PointerFromExposedAddress); // scope 0 at $DIR/as_cast.rs:+3:13: +3:34
- return; // scope 0 at $DIR/as_cast.rs:+4:13: +4:21
+ _0 = _1 as *const i32 (PointerFromExposedAddress);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir b/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir
index d159c1a65..836622ec2 100644
--- a/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir
+++ b/tests/mir-opt/building/custom/composite_return.tuple.built.after.mir
@@ -1,11 +1,11 @@
// MIR for `tuple` after built
fn tuple() -> (i32, bool) {
- let mut _0: (i32, bool); // return place in scope 0 at $DIR/composite_return.rs:+0:15: +0:26
+ let mut _0: (i32, bool);
bb0: {
- (_0.0: i32) = const 1_i32; // scope 0 at $DIR/composite_return.rs:+4:13: +4:22
- (_0.1: bool) = const true; // scope 0 at $DIR/composite_return.rs:+5:13: +5:25
- return; // scope 0 at $DIR/composite_return.rs:+6:13: +6:21
+ (_0.0: i32) = const 1_i32;
+ (_0.1: bool) = const true;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/consts.consts.built.after.mir b/tests/mir-opt/building/custom/consts.consts.built.after.mir
index ba753cfc2..05de272af 100644
--- a/tests/mir-opt/building/custom/consts.consts.built.after.mir
+++ b/tests/mir-opt/building/custom/consts.consts.built.after.mir
@@ -1,22 +1,19 @@
// MIR for `consts` after built
fn consts() -> () {
- 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
- let mut _4: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _5: fn() {consts::<10>}; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: ();
+ let mut _1: u8;
+ let mut _2: i8;
+ let mut _3: u32;
+ let mut _4: i32;
+ let mut _5: fn() {consts::<10>};
bb0: {
- _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:+7:9: +7:17
+ _1 = const 5_u8;
+ _2 = const _;
+ _3 = const C;
+ _4 = const _;
+ _5 = consts::<10>;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/consts.statics.built.after.mir b/tests/mir-opt/building/custom/consts.statics.built.after.mir
index bfef976aa..ea394c5b7 100644
--- a/tests/mir-opt/building/custom/consts.statics.built.after.mir
+++ b/tests/mir-opt/building/custom/consts.statics.built.after.mir
@@ -1,20 +1,14 @@
// MIR for `statics` after built
fn statics() -> () {
- 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
+ let mut _0: ();
+ let mut _1: &i32;
+ let mut _2: *mut i32;
bb0: {
- _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 $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:+4:9: +4:17
+ _1 = const {alloc1: &i32};
+ _2 = const {alloc2: *mut i32};
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.set_discr.built.after.mir b/tests/mir-opt/building/custom/enums.set_discr.built.after.mir
index 6d0747365..8cc66e7e5 100644
--- a/tests/mir-opt/building/custom/enums.set_discr.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.set_discr.built.after.mir
@@ -1,11 +1,11 @@
// MIR for `set_discr` after built
fn set_discr(_1: &mut Option<()>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/enums.rs:+0:39: +0:39
+ let mut _0: ();
bb0: {
- Deinit((*_1)); // scope 0 at $DIR/enums.rs:+2:9: +2:24
- discriminant((*_1)) = 0; // scope 0 at $DIR/enums.rs:+3:9: +3:36
- return; // scope 0 at $DIR/enums.rs:+4:9: +4:17
+ Deinit((*_1));
+ discriminant((*_1)) = 0;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir b/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir
index 6fdc3d0f4..55ade43ed 100644
--- a/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.set_discr_repr.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `set_discr_repr` after built
fn set_discr_repr(_1: &mut Bool) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/enums.rs:+0:33: +0:33
+ let mut _0: ();
bb0: {
- discriminant((*_1)) = 0; // scope 0 at $DIR/enums.rs:+2:9: +2:31
- return; // scope 0 at $DIR/enums.rs:+3:9: +3:17
+ discriminant((*_1)) = 0;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir
index 95c57d2dc..f82e5f1c6 100644
--- a/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.switch_bool.built.after.mir
@@ -1,19 +1,19 @@
// MIR for `switch_bool` after built
fn switch_bool(_1: bool) -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/enums.rs:+0:32: +0:35
+ let mut _0: u32;
bb0: {
- switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2]; // scope 0 at $DIR/enums.rs:+3:13: +7:14
+ switchInt(_1) -> [1: bb1, 0: bb2, otherwise: bb2];
}
bb1: {
- _0 = const 5_u32; // scope 0 at $DIR/enums.rs:+11:13: +11:20
- return; // scope 0 at $DIR/enums.rs:+12:13: +12:21
+ _0 = const 5_u32;
+ return;
}
bb2: {
- _0 = const 10_u32; // scope 0 at $DIR/enums.rs:+16:13: +16:21
- return; // scope 0 at $DIR/enums.rs:+17:13: +17:21
+ _0 = const 10_u32;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir
index a659ba7c1..fa03f274b 100644
--- a/tests/mir-opt/building/custom/enums.switch_option.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.switch_option.built.after.mir
@@ -1,21 +1,21 @@
// MIR for `switch_option` after built
fn switch_option(_1: Option<()>) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/enums.rs:+0:45: +0:49
- let mut _2: isize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: bool;
+ let mut _2: isize;
bb0: {
- _2 = discriminant(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2]; // scope 0 at $DIR/enums.rs:+4:13: +8:14
+ _2 = discriminant(_1);
+ switchInt(_2) -> [0: bb1, 1: bb2, otherwise: bb2];
}
bb1: {
- _0 = const false; // scope 0 at $DIR/enums.rs:+12:13: +12:24
- return; // scope 0 at $DIR/enums.rs:+13:13: +13:21
+ _0 = const false;
+ return;
}
bb2: {
- _0 = const true; // scope 0 at $DIR/enums.rs:+17:13: +17:23
- return; // scope 0 at $DIR/enums.rs:+18:13: +18:21
+ _0 = const true;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir
index d60e4b1b7..eec2197a8 100644
--- a/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir
+++ b/tests/mir-opt/building/custom/enums.switch_option_repr.built.after.mir
@@ -1,21 +1,21 @@
// MIR for `switch_option_repr` after built
fn switch_option_repr(_1: Bool) -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/enums.rs:+0:40: +0:44
- let mut _2: u8; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: bool;
+ let mut _2: u8;
bb0: {
- _2 = discriminant(_1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- switchInt(_2) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/enums.rs:+4:13: +7:14
+ _2 = discriminant(_1);
+ switchInt(_2) -> [0: bb2, otherwise: bb1];
}
bb1: {
- _0 = const true; // scope 0 at $DIR/enums.rs:+11:13: +11:23
- return; // scope 0 at $DIR/enums.rs:+12:13: +12:21
+ _0 = const true;
+ return;
}
bb2: {
- _0 = const false; // scope 0 at $DIR/enums.rs:+16:13: +16:24
- return; // scope 0 at $DIR/enums.rs:+17:13: +17:21
+ _0 = const false;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/operators.f.built.after.mir b/tests/mir-opt/building/custom/operators.f.built.after.mir
index cb43d5e6e..33eb6b720 100644
--- a/tests/mir-opt/building/custom/operators.f.built.after.mir
+++ b/tests/mir-opt/building/custom/operators.f.built.after.mir
@@ -1,30 +1,30 @@
// MIR for `f` after built
fn f(_1: i32, _2: bool) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/operators.rs:+0:30: +0:33
- let mut _3: (i32, bool); // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _3: (i32, bool);
bb0: {
- _1 = Neg(_1); // scope 0 at $DIR/operators.rs:+2:9: +2:15
- _2 = Not(_2); // scope 0 at $DIR/operators.rs:+3:9: +3:15
- _1 = Add(_1, _1); // scope 0 at $DIR/operators.rs:+4:9: +4:18
- _1 = Sub(_1, _1); // scope 0 at $DIR/operators.rs:+5:9: +5:18
- _1 = Mul(_1, _1); // scope 0 at $DIR/operators.rs:+6:9: +6:18
- _1 = Div(_1, _1); // scope 0 at $DIR/operators.rs:+7:9: +7:18
- _1 = Rem(_1, _1); // scope 0 at $DIR/operators.rs:+8:9: +8:18
- _1 = BitXor(_1, _1); // scope 0 at $DIR/operators.rs:+9:9: +9:18
- _1 = BitAnd(_1, _1); // scope 0 at $DIR/operators.rs:+10:9: +10:18
- _1 = Shl(_1, _1); // scope 0 at $DIR/operators.rs:+11:9: +11:19
- _1 = Shr(_1, _1); // scope 0 at $DIR/operators.rs:+12:9: +12:19
- _2 = Eq(_1, _1); // scope 0 at $DIR/operators.rs:+13:9: +13:19
- _2 = Lt(_1, _1); // scope 0 at $DIR/operators.rs:+14:9: +14:18
- _2 = Le(_1, _1); // scope 0 at $DIR/operators.rs:+15:9: +15:19
- _2 = Ge(_1, _1); // scope 0 at $DIR/operators.rs:+16:9: +16:19
- _2 = Gt(_1, _1); // scope 0 at $DIR/operators.rs:+17:9: +17:18
- _3 = CheckedAdd(_1, _1); // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _2 = (_3.1: bool); // scope 0 at $DIR/operators.rs:+19:9: +19:18
- _1 = (_3.0: i32); // scope 0 at $DIR/operators.rs:+20:9: +20:18
- _0 = _1; // scope 0 at $DIR/operators.rs:+21:9: +21:16
- return; // scope 0 at $DIR/operators.rs:+22:9: +22:17
+ _1 = Neg(_1);
+ _2 = Not(_2);
+ _1 = Add(_1, _1);
+ _1 = Sub(_1, _1);
+ _1 = Mul(_1, _1);
+ _1 = Div(_1, _1);
+ _1 = Rem(_1, _1);
+ _1 = BitXor(_1, _1);
+ _1 = BitAnd(_1, _1);
+ _1 = Shl(_1, _1);
+ _1 = Shr(_1, _1);
+ _2 = Eq(_1, _1);
+ _2 = Lt(_1, _1);
+ _2 = Le(_1, _1);
+ _2 = Ge(_1, _1);
+ _2 = Gt(_1, _1);
+ _3 = CheckedAdd(_1, _1);
+ _2 = (_3.1: bool);
+ _1 = (_3.0: i32);
+ _0 = _1;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir
index 5233d0489..b1ba5f931 100644
--- a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir
@@ -1,12 +1,12 @@
// MIR for `copy_for_deref` after built
fn copy_for_deref(_1: (&i32, i32)) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:38: +0:41
- let mut _2: &i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _2: &i32;
bb0: {
- _2 = deref_copy (_1.0: &i32); // scope 0 at $DIR/projections.rs:+4:13: +4:37
- _0 = (*_2); // scope 0 at $DIR/projections.rs:+5:13: +5:24
- return; // scope 0 at $DIR/projections.rs:+6:13: +6:21
+ _2 = deref_copy (_1.0: &i32);
+ _0 = (*_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.set.built.after.mir b/tests/mir-opt/building/custom/projections.set.built.after.mir
index 2f15176a6..9e756c504 100644
--- a/tests/mir-opt/building/custom/projections.set.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.set.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `set` after built
fn set(_1: &mut Option<i32>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/projections.rs:+0:31: +0:31
+ let mut _0: ();
bb0: {
- (((*_1) as variant#1).0: i32) = const 10_i32; // scope 0 at $DIR/projections.rs:+2:9: +2:48
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ (((*_1) as variant#1).0: i32) = const 10_i32;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir
index fc422e4b3..f74c61009 100644
--- a/tests/mir-opt/building/custom/projections.simple_index.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.simple_index.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `simple_index` after built
fn simple_index(_1: [i32; 10], _2: &[i32]) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:45: +0:48
- let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _3: usize;
bb0: {
- _3 = const 3_usize; // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- _0 = _1[_3]; // scope 0 at $DIR/projections.rs:+3:9: +3:22
- _0 = (*_2)[_3]; // scope 0 at $DIR/projections.rs:+4:9: +4:25
- return; // scope 0 at $DIR/projections.rs:+5:9: +5:17
+ _3 = const 3_usize;
+ _0 = _1[_3];
+ _0 = (*_2)[_3];
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.tuples.built.after.mir b/tests/mir-opt/building/custom/projections.tuples.built.after.mir
index dec575200..a370de2ed 100644
--- a/tests/mir-opt/building/custom/projections.tuples.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.tuples.built.after.mir
@@ -1,11 +1,11 @@
// MIR for `tuples` after built
fn tuples(_1: (u32, i32)) -> (u32, i32) {
- let mut _0: (u32, i32); // return place in scope 0 at $DIR/projections.rs:+0:29: +0:39
+ let mut _0: (u32, i32);
bb0: {
- (_0.0: u32) = (_1.0: u32); // scope 0 at $DIR/projections.rs:+4:13: +4:24
- (_0.1: i32) = (_1.1: i32); // scope 0 at $DIR/projections.rs:+5:13: +5:24
- return; // scope 0 at $DIR/projections.rs:+6:13: +6:21
+ (_0.0: u32) = (_1.0: u32);
+ (_0.1: i32) = (_1.1: i32);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.unions.built.after.mir b/tests/mir-opt/building/custom/projections.unions.built.after.mir
index 922538a5f..4189b329e 100644
--- a/tests/mir-opt/building/custom/projections.unions.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.unions.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `unions` after built
fn unions(_1: U) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:20: +0:23
+ let mut _0: i32;
bb0: {
- _0 = (_1.0: i32); // scope 0 at $DIR/projections.rs:+2:9: +2:18
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ _0 = (_1.0: i32);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir
index 75b03a3c3..0c43bdc9d 100644
--- a/tests/mir-opt/building/custom/projections.unwrap.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.unwrap.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `unwrap` after built
fn unwrap(_1: Option<i32>) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:32: +0:35
+ let mut _0: i32;
bb0: {
- _0 = ((_1 as variant#1).0: i32); // scope 0 at $DIR/projections.rs:+2:9: +2:40
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ _0 = ((_1 as variant#1).0: i32);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir
index c6b0f7efa..39e978513 100644
--- a/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir
+++ b/tests/mir-opt/building/custom/projections.unwrap_deref.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `unwrap_deref` after built
fn unwrap_deref(_1: Option<&i32>) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/projections.rs:+0:39: +0:42
+ let mut _0: i32;
bb0: {
- _0 = (*((_1 as variant#1).0: &i32)); // scope 0 at $DIR/projections.rs:+2:9: +2:49
- return; // scope 0 at $DIR/projections.rs:+3:9: +3:17
+ _0 = (*((_1 as variant#1).0: &i32));
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.immut_ref.built.after.mir b/tests/mir-opt/building/custom/references.immut_ref.built.after.mir
index f5ee11262..d1e1aab99 100644
--- a/tests/mir-opt/building/custom/references.immut_ref.built.after.mir
+++ b/tests/mir-opt/building/custom/references.immut_ref.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `immut_ref` after built
fn immut_ref(_1: &i32) -> &i32 {
- let mut _0: &i32; // return place in scope 0 at $DIR/references.rs:+0:30: +0:34
- let mut _2: *const i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: &i32;
+ let mut _2: *const i32;
bb0: {
- _2 = &raw const (*_1); // scope 0 at $DIR/references.rs:+5:13: +5:29
- _0 = &(*_2); // scope 0 at $DIR/references.rs:+6:13: +6:23
- Retag(_0); // scope 0 at $DIR/references.rs:+7:13: +7:23
- return; // scope 0 at $DIR/references.rs:+8:13: +8:21
+ _2 = &raw const (*_1);
+ _0 = &(*_2);
+ Retag(_0);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.mut_ref.built.after.mir b/tests/mir-opt/building/custom/references.mut_ref.built.after.mir
index 8e2ffc33b..c82cb3274 100644
--- a/tests/mir-opt/building/custom/references.mut_ref.built.after.mir
+++ b/tests/mir-opt/building/custom/references.mut_ref.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `mut_ref` after built
fn mut_ref(_1: &mut i32) -> &mut i32 {
- let mut _0: &mut i32; // return place in scope 0 at $DIR/references.rs:+0:32: +0:40
- let mut _2: *mut i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: &mut i32;
+ let mut _2: *mut i32;
bb0: {
- _2 = &raw mut (*_1); // scope 0 at $DIR/references.rs:+5:13: +5:33
- _0 = &mut (*_2); // scope 0 at $DIR/references.rs:+6:13: +6:26
- Retag(_0); // scope 0 at $DIR/references.rs:+7:13: +7:23
- return; // scope 0 at $DIR/references.rs:+8:13: +8:21
+ _2 = &raw mut (*_1);
+ _0 = &mut (*_2);
+ Retag(_0);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir b/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir
index 775e5e3ad..57c7f92a3 100644
--- a/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir
+++ b/tests/mir-opt/building/custom/references.raw_pointer.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `raw_pointer` after built
fn raw_pointer(_1: *const i32) -> *const i32 {
- let mut _0: *const i32; // return place in scope 0 at $DIR/references.rs:+0:38: +0:48
+ let mut _0: *const i32;
bb0: {
- _0 = &raw const (*_1); // scope 0 at $DIR/references.rs:+4:9: +4:27
- return; // scope 0 at $DIR/references.rs:+5:9: +5:17
+ _0 = &raw const (*_1);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
index f614aef40..8046b543e 100644
--- a/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
+++ b/tests/mir-opt/building/custom/references.raw_pointer_offset.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `raw_pointer_offset` after built
fn raw_pointer_offset(_1: *const i32) -> *const i32 {
- let mut _0: *const i32; // return place in scope 0 at $DIR/references.rs:+0:45: +0:55
+ let mut _0: *const i32;
bb0: {
- _0 = Offset(_1, const 1_isize); // scope 0 at $DIR/references.rs:+2:9: +2:33
- return; // scope 0 at $DIR/references.rs:+3:9: +3:17
+ _0 = Offset(_1, const 1_isize);
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir
index 743016708..6f7aaeed9 100644
--- a/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir
+++ b/tests/mir-opt/building/custom/simple_assign.simple.built.after.mir
@@ -1,20 +1,20 @@
// MIR for `simple` after built
fn simple(_1: i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/simple_assign.rs:+0:26: +0:29
- let mut _2: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
- let mut _3: i32; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
+ let mut _0: i32;
+ let mut _2: i32;
+ let mut _3: i32;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/simple_assign.rs:+6:13: +6:31
- _2 = _1; // scope 0 at $DIR/simple_assign.rs:+7:13: +7:22
- goto -> bb1; // scope 0 at $DIR/simple_assign.rs:+8:13: +8:23
+ StorageLive(_2);
+ _2 = _1;
+ goto -> bb1;
}
bb1: {
- _3 = move _2; // scope 0 at $DIR/simple_assign.rs:+12:13: +12:32
- StorageDead(_2); // scope 0 at $DIR/simple_assign.rs:+13:13: +13:31
- _0 = _3; // scope 0 at $DIR/simple_assign.rs:+14:13: +14:24
- return; // scope 0 at $DIR/simple_assign.rs:+15:13: +15:21
+ _3 = move _2;
+ StorageDead(_2);
+ _0 = _3;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir b/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
index 2b0e8f104..b6d822998 100644
--- a/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
+++ b/tests/mir-opt/building/custom/simple_assign.simple_ref.built.after.mir
@@ -1,10 +1,10 @@
// MIR for `simple_ref` after built
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
+ let mut _0: &mut i32;
bb0: {
- _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
+ _0 = move _1;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir
index a1a27226b..9cf26dff3 100644
--- a/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.assert_nonzero.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `assert_nonzero` after built
fn assert_nonzero(_1: i32) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:27: +0:27
+ let mut _0: ();
bb0: {
- switchInt(_1) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/terminators.rs:+3:13: +6:14
+ switchInt(_1) -> [0: bb1, otherwise: bb2];
}
bb1: {
- unreachable; // scope 0 at $DIR/terminators.rs:+10:13: +10:26
+ unreachable;
}
bb2: {
- return; // scope 0 at $DIR/terminators.rs:+14:13: +14:21
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir
index 1b2345a96..07044ceae 100644
--- a/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.direct_call.built.after.mir
@@ -1,16 +1,13 @@
// MIR for `direct_call` after built
fn direct_call(_1: i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/terminators.rs:+0:27: +0:30
+ let mut _0: i32;
bb0: {
- _0 = ident::<i32>(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:42
- // mir::Constant
- // + span: $DIR/terminators.rs:15:33: 15:38
- // + literal: Const { ty: fn(i32) -> i32 {ident::<i32>}, val: Value(<ZST>) }
+ _0 = ident::<i32>(_1) -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir b/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir
index ada78c0fc..6524f754d 100644
--- a/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.drop_first.built.after.mir
@@ -1,14 +1,14 @@
// MIR for `drop_first` after built
fn drop_first(_1: WriteOnDrop<'_>, _2: WriteOnDrop<'_>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:59: +0:59
+ let mut _0: ();
bb0: {
- drop(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:30
+ drop(_1) -> [return: bb1, unwind continue];
}
bb1: {
- _1 = move _2; // scope 0 at $DIR/terminators.rs:+7:13: +7:24
- return; // scope 0 at $DIR/terminators.rs:+8:13: +8:21
+ _1 = move _2;
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir b/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir
index f14246f2d..ed3728121 100644
--- a/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.drop_second.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `drop_second` after built
fn drop_second(_1: WriteOnDrop<'_>, _2: WriteOnDrop<'_>) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/terminators.rs:+0:60: +0:60
+ let mut _0: ();
bb0: {
- drop(_2) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:30
+ drop(_2) -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21
+ return;
}
}
diff --git a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir
index 2f1b14069..3b849354d 100644
--- a/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir
+++ b/tests/mir-opt/building/custom/terminators.indirect_call.built.after.mir
@@ -1,13 +1,13 @@
// MIR for `indirect_call` after built
fn indirect_call(_1: i32, _2: fn(i32) -> i32) -> i32 {
- let mut _0: i32; // return place in scope 0 at $DIR/terminators.rs:+0:48: +0:51
+ let mut _0: i32;
bb0: {
- _0 = _2(_1) -> bb1; // scope 0 at $DIR/terminators.rs:+3:13: +3:38
+ _0 = _2(_1) -> [return: bb1, unwind continue];
}
bb1: {
- return; // scope 0 at $DIR/terminators.rs:+7:13: +7:21
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.bar.built.after.mir b/tests/mir-opt/building/enum_cast.bar.built.after.mir
index 9f14c0284..512c73216 100644
--- a/tests/mir-opt/building/enum_cast.bar.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.bar.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `bar` after built
fn bar(_1: Bar) -> usize {
- debug bar => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Bar; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _4: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ debug bar => _1;
+ let mut _0: usize;
+ let _2: Bar;
+ let mut _3: isize;
+ let mut _4: u8;
+ let mut _5: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _4 = _3 as u8 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _5 = Le(_4, const 1_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- assume(move _5); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u8 (IntToInt);
+ _5 = Le(_4, const 1_u8);
+ assume(move _5);
+ _0 = move _3 as usize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.boo.built.after.mir b/tests/mir-opt/building/enum_cast.boo.built.after.mir
index 715dedcf2..ad0adf14e 100644
--- a/tests/mir-opt/building/enum_cast.boo.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.boo.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `boo` after built
fn boo(_1: Boo) -> usize {
- debug boo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Boo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _4: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ debug boo => _1;
+ let mut _0: usize;
+ let _2: Boo;
+ let mut _3: u8;
+ let mut _4: u8;
+ let mut _5: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _4 = _3 as u8 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _5 = Le(_4, const 1_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- assume(move _5); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u8 (IntToInt);
+ _5 = Le(_4, const 1_u8);
+ assume(move _5);
+ _0 = move _3 as usize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.droppy.built.after.mir b/tests/mir-opt/building/enum_cast.droppy.built.after.mir
index 6c177c61e..1caf9e4a5 100644
--- a/tests/mir-opt/building/enum_cast.droppy.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.droppy.built.after.mir
@@ -1,71 +1,71 @@
// MIR for `droppy` after built
fn droppy() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/enum_cast.rs:+0:13: +0:13
- let _1: (); // in scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
- let _2: Droppy; // in scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
- let _4: Droppy; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
- let mut _5: isize; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
- let mut _6: u8; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:27
- let mut _7: bool; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:27
- let _8: Droppy; // in scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
+ let mut _0: ();
+ let _1: ();
+ let _2: Droppy;
+ let _4: Droppy;
+ let mut _5: isize;
+ let mut _6: u8;
+ let mut _7: bool;
+ let _8: Droppy;
scope 1 {
- debug x => _2; // in scope 1 at $DIR/enum_cast.rs:+2:13: +2:14
+ debug x => _2;
scope 2 {
- debug y => _3; // in scope 2 at $DIR/enum_cast.rs:+5:13: +5:14
+ debug y => _3;
}
scope 3 {
- let _3: usize; // in scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
+ let _3: usize;
}
}
scope 4 {
- debug z => _8; // in scope 4 at $DIR/enum_cast.rs:+7:9: +7:10
+ debug z => _8;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
- _2 = Droppy::C; // scope 0 at $DIR/enum_cast.rs:+2:17: +2:26
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
- StorageLive(_3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
- StorageLive(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
- _4 = move _2; // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
- _5 = discriminant(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- _6 = _5 as u8 (IntToInt); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- _7 = Le(_6, const 2_u8); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- assume(move _7); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- _3 = move _5 as usize (IntToInt); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- drop(_4) -> [return: bb1, unwind: bb4]; // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Droppy::C;
+ FakeRead(ForLet(None), _2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = move _2;
+ _5 = discriminant(_4);
+ _6 = _5 as u8 (IntToInt);
+ _7 = Le(_6, const 2_u8);
+ assume(move _7);
+ _3 = move _5 as usize (IntToInt);
+ drop(_4) -> [return: bb1, unwind: bb4];
}
bb1: {
- StorageDead(_4); // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
- FakeRead(ForLet(None), _3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
- _1 = const (); // scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
- StorageDead(_3); // scope 1 at $DIR/enum_cast.rs:+6:5: +6:6
- drop(_2) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
+ StorageDead(_4);
+ FakeRead(ForLet(None), _3);
+ _1 = const ();
+ StorageDead(_3);
+ drop(_2) -> [return: bb2, unwind: bb5];
}
bb2: {
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
- StorageDead(_1); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
- StorageLive(_8); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
- _8 = Droppy::B; // scope 0 at $DIR/enum_cast.rs:+7:13: +7:22
- FakeRead(ForLet(None), _8); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
- _0 = const (); // scope 0 at $DIR/enum_cast.rs:+0:13: +8:2
- drop(_8) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
+ StorageDead(_2);
+ StorageDead(_1);
+ StorageLive(_8);
+ _8 = Droppy::B;
+ FakeRead(ForLet(None), _8);
+ _0 = const ();
+ drop(_8) -> [return: bb3, unwind: bb5];
}
bb3: {
- StorageDead(_8); // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
- return; // scope 0 at $DIR/enum_cast.rs:+8:2: +8:2
+ StorageDead(_8);
+ return;
}
bb4 (cleanup): {
- drop(_2) -> [return: bb5, unwind terminate]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
+ drop(_2) -> [return: bb5, unwind terminate];
}
bb5 (cleanup): {
- resume; // scope 0 at $DIR/enum_cast.rs:+0:1: +8:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/enum_cast.far.built.after.mir b/tests/mir-opt/building/enum_cast.far.built.after.mir
index ab8129ca0..e75803c70 100644
--- a/tests/mir-opt/building/enum_cast.far.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.far.built.after.mir
@@ -1,22 +1,22 @@
// MIR for `far` after built
fn far(_1: Far) -> isize {
- debug far => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: isize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Far; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: i16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _4: u16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ debug far => _1;
+ let mut _0: isize;
+ let _2: Far;
+ let mut _3: i16;
+ let mut _4: u16;
+ let mut _5: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _4 = _3 as u16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _5 = Le(_4, const 1_u16); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- assume(move _5); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as isize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u16 (IntToInt);
+ _5 = Le(_4, const 1_u16);
+ assume(move _5);
+ _0 = move _3 as isize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.foo.built.after.mir b/tests/mir-opt/building/enum_cast.foo.built.after.mir
index 17e0abf2e..d4eea0534 100644
--- a/tests/mir-opt/building/enum_cast.foo.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.foo.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `foo` after built
fn foo(_1: Foo) -> usize {
- debug foo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
- let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let _2: Foo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ debug foo => _1;
+ let mut _0: usize;
+ let _2: Foo;
+ let mut _3: isize;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _0 = move _3 as usize (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir
index 7b2b583f2..282859d7c 100644
--- a/tests/mir-opt/building/enum_cast.offsetty.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.offsetty.built.after.mir
@@ -1,26 +1,26 @@
// MIR for `offsetty` after built
fn offsetty(_1: NotStartingAtZero) -> u32 {
- debug x => _1; // in scope 0 at $DIR/enum_cast.rs:+0:13: +0:14
- let mut _0: u32; // return place in scope 0 at $DIR/enum_cast.rs:+0:38: +0:41
- let _2: NotStartingAtZero; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _4: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _6: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _7: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
+ debug x => _1;
+ let mut _0: u32;
+ let _2: NotStartingAtZero;
+ let mut _3: isize;
+ let mut _4: u8;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _4 = _3 as u8 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _5 = Ge(_4, const 4_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _6 = Le(_4, const 8_u8); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _7 = BitAnd(move _5, move _6); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- assume(move _7); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _0 = move _3 as u32 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:12: +1:13
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u8 (IntToInt);
+ _5 = Ge(_4, const 4_u8);
+ _6 = Le(_4, const 8_u8);
+ _7 = BitAnd(move _5, move _6);
+ assume(move _7);
+ _0 = move _3 as u32 (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.signy.built.after.mir b/tests/mir-opt/building/enum_cast.signy.built.after.mir
index ef4fea604..a9f7d6c78 100644
--- a/tests/mir-opt/building/enum_cast.signy.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.signy.built.after.mir
@@ -1,26 +1,26 @@
// MIR for `signy` after built
fn signy(_1: SignedAroundZero) -> i16 {
- debug x => _1; // in scope 0 at $DIR/enum_cast.rs:+0:10: +0:11
- let mut _0: i16; // return place in scope 0 at $DIR/enum_cast.rs:+0:34: +0:37
- let _2: SignedAroundZero; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _3: i16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- let mut _4: u16; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _5: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _6: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- let mut _7: bool; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
+ debug x => _1;
+ let mut _0: i16;
+ let _2: SignedAroundZero;
+ let mut _3: i16;
+ let mut _4: u16;
+ let mut _5: bool;
+ let mut _6: bool;
+ let mut _7: bool;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:6
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _4 = _3 as u16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _5 = Ge(_4, const 65534_u16); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _6 = Le(_4, const 2_u16); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _7 = BitOr(move _5, move _6); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- assume(move _7); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- _0 = move _3 as i16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:13
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:12: +1:13
- return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _4 = _3 as u16 (IntToInt);
+ _5 = Ge(_4, const 65534_u16);
+ _6 = Le(_4, const 2_u16);
+ _7 = BitOr(move _5, move _6);
+ assume(move _7);
+ _0 = move _3 as i16 (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/enum_cast.unsigny.built.after.mir b/tests/mir-opt/building/enum_cast.unsigny.built.after.mir
index 7ca147b15..a232ab942 100644
--- a/tests/mir-opt/building/enum_cast.unsigny.built.after.mir
+++ b/tests/mir-opt/building/enum_cast.unsigny.built.after.mir
@@ -1,17 +1,17 @@
// MIR for `unsigny` after built
fn unsigny(_1: UnsignedAroundZero) -> u16 {
- debug x => _1; // in scope 0 at $DIR/enum_cast.rs:+0:12: +0:13
- let mut _0: u16; // return place in scope 0 at $DIR/enum_cast.rs:+0:38: +0:41
- let _2: UnsignedAroundZero; // in scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
- let mut _3: u16; // in scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
+ debug x => _1;
+ let mut _0: u16;
+ let _2: UnsignedAroundZero;
+ let mut _3: u16;
bb0: {
- StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
- _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+2:5: +2:6
- _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+2:5: +2:13
- _0 = move _3 as u16 (IntToInt); // scope 0 at $DIR/enum_cast.rs:+2:5: +2:13
- StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+2:12: +2:13
- return; // scope 0 at $DIR/enum_cast.rs:+3:2: +3:2
+ StorageLive(_2);
+ _2 = move _1;
+ _3 = discriminant(_2);
+ _0 = move _3 as u16 (IntToInt);
+ StorageDead(_2);
+ return;
}
}
diff --git a/tests/mir-opt/building/issue_101867.main.built.after.mir b/tests/mir-opt/building/issue_101867.main.built.after.mir
index 44c25ce67..915c5ef11 100644
--- a/tests/mir-opt/building/issue_101867.main.built.after.mir
+++ b/tests/mir-opt/building/issue_101867.main.built.after.mir
@@ -5,71 +5,65 @@
| 1: user_ty: Canonical { value: Ty(std::option::Option<u8>), max_universe: U0, variables: [] }, span: $DIR/issue_101867.rs:3:12: 3:22, inferred_ty: std::option::Option<u8>
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_101867.rs:+0:11: +0:11
- let _1: std::option::Option<u8> as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/issue_101867.rs:+1:9: +1:10
- let mut _2: !; // in scope 0 at $DIR/issue_101867.rs:+2:26: +4:6
- let _3: (); // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- let mut _4: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
- let mut _6: isize; // in scope 0 at $DIR/issue_101867.rs:+2:9: +2:16
+ let mut _0: ();
+ let _1: std::option::Option<u8> as UserTypeProjection { base: UserType(0), projs: [] };
+ let mut _2: !;
+ let _3: ();
+ let mut _4: !;
+ let mut _6: isize;
scope 1 {
- debug x => _1; // in scope 1 at $DIR/issue_101867.rs:+1:9: +1:10
- let _5: u8; // in scope 1 at $DIR/issue_101867.rs:+2:14: +2:15
+ debug x => _1;
+ let _5: u8;
scope 2 {
- debug y => _5; // in scope 2 at $DIR/issue_101867.rs:+2:14: +2:15
+ debug y => _5;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue_101867.rs:+1:9: +1:10
- _1 = Option::<u8>::Some(const 1_u8); // scope 0 at $DIR/issue_101867.rs:+1:25: +1:32
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/issue_101867.rs:+1:9: +1:10
- AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/issue_101867.rs:+1:12: +1:22
- StorageLive(_5); // scope 1 at $DIR/issue_101867.rs:+2:14: +2:15
- FakeRead(ForMatchedPlace(None), _1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
- _6 = discriminant(_1); // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
- switchInt(move _6) -> [1: bb4, otherwise: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16
+ StorageLive(_1);
+ _1 = Option::<u8>::Some(const 1_u8);
+ FakeRead(ForLet(None), _1);
+ AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] });
+ StorageLive(_5);
+ FakeRead(ForMatchedPlace(None), _1);
+ _6 = discriminant(_1);
+ switchInt(move _6) -> [1: bb4, otherwise: bb3];
}
bb1: {
- StorageLive(_3); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- StorageLive(_4); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- _4 = begin_panic::<&str>(const "explicit panic") -> bb7; // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/std/src/panic.rs:LL:COL
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = begin_panic::<&str>(const "explicit panic") -> bb7;
}
bb2: {
- StorageDead(_4); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
- StorageDead(_3); // scope 1 at $DIR/issue_101867.rs:+3:16: +3:17
- unreachable; // scope 1 at $DIR/issue_101867.rs:+2:26: +4:6
+ StorageDead(_4);
+ StorageDead(_3);
+ unreachable;
}
bb3: {
- goto -> bb6; // scope 1 at $DIR/issue_101867.rs:+2:19: +2:20
+ goto -> bb6;
}
bb4: {
- falseEdge -> [real: bb5, imaginary: bb3]; // scope 1 at $DIR/issue_101867.rs:+2:9: +2:16
+ falseEdge -> [real: bb5, imaginary: bb3];
}
bb5: {
- _5 = ((_1 as Some).0: u8); // scope 1 at $DIR/issue_101867.rs:+2:14: +2:15
- _0 = const (); // scope 0 at $DIR/issue_101867.rs:+0:11: +5:2
- StorageDead(_5); // scope 1 at $DIR/issue_101867.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/issue_101867.rs:+5:1: +5:2
- return; // scope 0 at $DIR/issue_101867.rs:+5:2: +5:2
+ _5 = ((_1 as Some).0: u8);
+ _0 = const ();
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
}
bb6: {
- StorageDead(_5); // scope 1 at $DIR/issue_101867.rs:+5:1: +5:2
- goto -> bb1; // scope 0 at $DIR/issue_101867.rs:+0:11: +5:2
+ StorageDead(_5);
+ goto -> bb1;
}
bb7 (cleanup): {
- resume; // scope 0 at $DIR/issue_101867.rs:+0:1: +5:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/issue_110508.rs b/tests/mir-opt/building/issue_110508.rs
new file mode 100644
index 000000000..bcbb1c298
--- /dev/null
+++ b/tests/mir-opt/building/issue_110508.rs
@@ -0,0 +1,13 @@
+// EMIT_MIR issue_110508.{impl#0}-BAR.built.after.mir
+// EMIT_MIR issue_110508.{impl#0}-SELF_BAR.built.after.mir
+
+enum Foo {
+ Bar(()),
+}
+
+impl Foo {
+ const BAR: Foo = Foo::Bar(());
+ const SELF_BAR: Foo = Self::Bar(());
+}
+
+fn main() {}
diff --git a/tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir b/tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir
new file mode 100644
index 000000000..5fc6d911a
--- /dev/null
+++ b/tests/mir-opt/building/issue_110508.{impl#0}-BAR.built.after.mir
@@ -0,0 +1,14 @@
+// MIR for `<impl at $DIR/issue_110508.rs:8:1: 8:9>::BAR` after built
+
+const <impl at $DIR/issue_110508.rs:8:1: 8:9>::BAR: Foo = {
+ let mut _0: Foo;
+ let mut _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = ();
+ _0 = Foo::Bar(move _1);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir b/tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir
new file mode 100644
index 000000000..1a8925599
--- /dev/null
+++ b/tests/mir-opt/building/issue_110508.{impl#0}-SELF_BAR.built.after.mir
@@ -0,0 +1,14 @@
+// MIR for `<impl at $DIR/issue_110508.rs:8:1: 8:9>::SELF_BAR` after built
+
+const <impl at $DIR/issue_110508.rs:8:1: 8:9>::SELF_BAR: Foo = {
+ let mut _0: Foo;
+ let mut _1: ();
+
+ bb0: {
+ StorageLive(_1);
+ _1 = ();
+ _0 = Foo::Bar(move _1);
+ StorageDead(_1);
+ return;
+ }
+}
diff --git a/tests/mir-opt/building/issue_49232.main.built.after.mir b/tests/mir-opt/building/issue_49232.main.built.after.mir
index cc135f417..f809132bc 100644
--- a/tests/mir-opt/building/issue_49232.main.built.after.mir
+++ b/tests/mir-opt/building/issue_49232.main.built.after.mir
@@ -1,82 +1,79 @@
// MIR for `main` after built
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue_49232.rs:+0:11: +0:11
- let mut _1: (); // in scope 0 at $DIR/issue_49232.rs:+0:1: +10:2
- let _2: i32; // in scope 0 at $DIR/issue_49232.rs:+2:13: +2:19
- let mut _3: bool; // in scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- let mut _4: !; // in scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
- let _5: (); // in scope 0 at $DIR/issue_49232.rs:+8:9: +8:22
- let mut _6: &i32; // in scope 0 at $DIR/issue_49232.rs:+8:14: +8:21
+ let mut _0: ();
+ let mut _1: ();
+ let _2: i32;
+ let mut _3: bool;
+ let mut _4: !;
+ let _5: ();
+ let mut _6: &i32;
scope 1 {
- debug beacon => _2; // in scope 1 at $DIR/issue_49232.rs:+2:13: +2:19
+ debug beacon => _2;
}
bb0: {
- goto -> bb1; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
+ goto -> bb1;
}
bb1: {
- falseUnwind -> [real: bb2, unwind: bb11]; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
+ falseUnwind -> [real: bb2, unwind: bb11];
}
bb2: {
- StorageLive(_2); // scope 0 at $DIR/issue_49232.rs:+2:13: +2:19
- StorageLive(_3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- _3 = const true; // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- FakeRead(ForMatchedPlace(None), _3); // scope 0 at $DIR/issue_49232.rs:+3:19: +3:23
- switchInt(_3) -> [0: bb3, otherwise: bb4]; // scope 0 at $DIR/issue_49232.rs:+3:13: +3:23
+ StorageLive(_2);
+ StorageLive(_3);
+ _3 = const true;
+ FakeRead(ForMatchedPlace(None), _3);
+ switchInt(_3) -> [0: bb3, otherwise: bb4];
}
bb3: {
- falseEdge -> [real: bb5, imaginary: bb4]; // scope 0 at $DIR/issue_49232.rs:+4:17: +4:22
+ falseEdge -> [real: bb5, imaginary: bb4];
}
bb4: {
- _0 = const (); // scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
- goto -> bb10; // scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
+ _0 = const ();
+ goto -> bb10;
}
bb5: {
- _2 = const 4_i32; // scope 0 at $DIR/issue_49232.rs:+4:26: +4:27
- goto -> bb8; // scope 0 at $DIR/issue_49232.rs:+4:26: +4:27
+ _2 = const 4_i32;
+ goto -> bb8;
}
bb6: {
- unreachable; // scope 0 at $DIR/issue_49232.rs:+5:25: +5:30
+ unreachable;
}
bb7: {
- goto -> bb8; // scope 0 at $DIR/issue_49232.rs:+6:13: +6:14
+ goto -> bb8;
}
bb8: {
- FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue_49232.rs:+2:13: +2:19
- StorageDead(_3); // scope 0 at $DIR/issue_49232.rs:+7:10: +7:11
- StorageLive(_5); // scope 1 at $DIR/issue_49232.rs:+8:9: +8:22
- StorageLive(_6); // scope 1 at $DIR/issue_49232.rs:+8:14: +8:21
- _6 = &_2; // scope 1 at $DIR/issue_49232.rs:+8:14: +8:21
- _5 = std::mem::drop::<&i32>(move _6) -> [return: bb9, unwind: bb11]; // scope 1 at $DIR/issue_49232.rs:+8:9: +8:22
- // mir::Constant
- // + span: $DIR/issue_49232.rs:13:9: 13:13
- // + literal: Const { ty: fn(&i32) {std::mem::drop::<&i32>}, val: Value(<ZST>) }
+ FakeRead(ForLet(None), _2);
+ StorageDead(_3);
+ StorageLive(_5);
+ StorageLive(_6);
+ _6 = &_2;
+ _5 = std::mem::drop::<&i32>(move _6) -> [return: bb9, unwind: bb11];
}
bb9: {
- StorageDead(_6); // scope 1 at $DIR/issue_49232.rs:+8:21: +8:22
- StorageDead(_5); // scope 1 at $DIR/issue_49232.rs:+8:22: +8:23
- _1 = const (); // scope 0 at $DIR/issue_49232.rs:+1:10: +9:6
- StorageDead(_2); // scope 0 at $DIR/issue_49232.rs:+9:5: +9:6
- goto -> bb1; // scope 0 at $DIR/issue_49232.rs:+1:5: +9:6
+ StorageDead(_6);
+ StorageDead(_5);
+ _1 = const ();
+ StorageDead(_2);
+ goto -> bb1;
}
bb10: {
- StorageDead(_3); // scope 0 at $DIR/issue_49232.rs:+7:10: +7:11
- StorageDead(_2); // scope 0 at $DIR/issue_49232.rs:+9:5: +9:6
- return; // scope 0 at $DIR/issue_49232.rs:+10:2: +10:2
+ StorageDead(_3);
+ StorageDead(_2);
+ return;
}
bb11 (cleanup): {
- resume; // scope 0 at $DIR/issue_49232.rs:+0:1: +10:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir b/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir
index 0e6de839d..bd4cd4eb6 100644
--- a/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir
+++ b/tests/mir-opt/building/match_false_edges.full_tested_match.built.after.mir
@@ -1,113 +1,110 @@
// MIR for `full_tested_match` after built
fn full_tested_match() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:28: +0:28
- let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
- let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:35: +2:36
- let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15
- let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:+3:24: +3:25
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ let mut _2: std::option::Option<i32>;
+ let mut _3: isize;
+ let mut _4: &std::option::Option<i32>;
+ let _5: i32;
+ let _6: &i32;
+ let mut _7: bool;
+ let mut _8: i32;
+ let _9: i32;
+ let mut _10: i32;
scope 1 {
}
scope 2 {
- debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
- debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
+ debug x => _5;
+ debug x => _6;
}
scope 3 {
- debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:+3:14: +3:15
+ debug y => _9;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<i32>::Some(const 42_i32);
+ FakeRead(ForMatchedPlace(None), _2);
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4];
}
bb1: {
- _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:+4:17: +4:23
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+4:17: +4:23
+ _1 = (const 3_i32, const 3_i32);
+ goto -> bb11;
}
bb2: {
- falseEdge -> [real: bb5, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
+ falseEdge -> [real: bb5, imaginary: bb3];
}
bb3: {
- falseEdge -> [real: bb10, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:16
+ falseEdge -> [real: bb10, imaginary: bb1];
}
bb4: {
- unreachable; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
+ unreachable;
}
bb5: {
- StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- _7 = guard() -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:14:20: 14:25
- // + literal: Const { ty: fn() -> bool {guard}, val: Value(<ZST>) }
+ StorageLive(_6);
+ _6 = &((_2 as Some).0: i32);
+ _4 = &shallow _2;
+ StorageLive(_7);
+ _7 = guard() -> [return: bb6, unwind: bb12];
}
bb6: {
- switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ switchInt(move _7) -> [0: bb8, otherwise: bb7];
}
bb7: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _8 = _5; // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:+2:31: +2:37
- StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
+ StorageDead(_7);
+ FakeRead(ForMatchGuard, _4);
+ FakeRead(ForGuardBinding, _6);
+ StorageLive(_5);
+ _5 = ((_2 as Some).0: i32);
+ StorageLive(_8);
+ _8 = _5;
+ _1 = (const 1_i32, move _8);
+ StorageDead(_8);
+ StorageDead(_5);
+ StorageDead(_6);
+ goto -> bb11;
}
bb8: {
- goto -> bb9; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ goto -> bb9;
}
bb9: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- goto -> bb3; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ StorageDead(_7);
+ StorageDead(_6);
+ goto -> bb3;
}
bb10: {
- StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15
- _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15
- StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:+3:24: +3:25
- _10 = _9; // scope 3 at $DIR/match_false_edges.rs:+3:24: +3:25
- _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:+3:20: +3:26
- StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:+3:25: +3:26
- StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+3:25: +3:26
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+3:25: +3:26
+ StorageLive(_9);
+ _9 = ((_2 as Some).0: i32);
+ StorageLive(_10);
+ _10 = _9;
+ _1 = (const 2_i32, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ goto -> bb11;
}
bb11: {
- PlaceMention(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:28: +6:2
- return; // scope 0 at $DIR/match_false_edges.rs:+6:2: +6:2
+ PlaceMention(_1);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +6:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir b/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir
index 37e6b1cd4..595e3ab92 100644
--- a/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir
+++ b/tests/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir
@@ -1,113 +1,110 @@
// MIR for `full_tested_match2` after built
fn full_tested_match2() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:29: +0:29
- let mut _1: (i32, i32); // in scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
- let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- let _5: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let _6: &i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- let mut _7: bool; // in scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:35: +2:36
- let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:24: +4:25
+ let mut _0: ();
+ let mut _1: (i32, i32);
+ let mut _2: std::option::Option<i32>;
+ let mut _3: isize;
+ let mut _4: &std::option::Option<i32>;
+ let _5: i32;
+ let _6: &i32;
+ let mut _7: bool;
+ let mut _8: i32;
+ let _9: i32;
+ let mut _10: i32;
scope 1 {
}
scope 2 {
- debug x => _5; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
- debug x => _6; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:15
+ debug x => _5;
+ debug x => _6;
}
scope 3 {
- debug y => _9; // in scope 3 at $DIR/match_false_edges.rs:+4:14: +4:15
+ debug y => _9;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _2 = Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:27
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<i32>::Some(const 42_i32);
+ FakeRead(ForMatchedPlace(None), _2);
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [0: bb1, 1: bb2, otherwise: bb4];
}
bb1: {
- falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:13
+ falseEdge -> [real: bb10, imaginary: bb3];
}
bb2: {
- falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:16
+ falseEdge -> [real: bb5, imaginary: bb1];
}
bb3: {
- StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:+4:24: +4:25
- _10 = _9; // scope 3 at $DIR/match_false_edges.rs:+4:24: +4:25
- _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:+4:20: +4:26
- StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:+4:25: +4:26
- StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+4:25: +4:26
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+4:25: +4:26
+ StorageLive(_9);
+ _9 = ((_2 as Some).0: i32);
+ StorageLive(_10);
+ _10 = _9;
+ _1 = (const 2_i32, move _10);
+ StorageDead(_10);
+ StorageDead(_9);
+ goto -> bb11;
}
bb4: {
- unreachable; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
+ unreachable;
}
bb5: {
- StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27
- StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- _7 = guard() -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:25:20: 25:25
- // + literal: Const { ty: fn() -> bool {guard}, val: Value(<ZST>) }
+ StorageLive(_6);
+ _6 = &((_2 as Some).0: i32);
+ _4 = &shallow _2;
+ StorageLive(_7);
+ _7 = guard() -> [return: bb6, unwind: bb12];
}
bb6: {
- switchInt(move _7) -> [0: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ switchInt(move _7) -> [0: bb8, otherwise: bb7];
}
bb7: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForMatchGuard, _4); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- FakeRead(ForGuardBinding, _6); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageLive(_5); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _5 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _8 = _5; // scope 2 at $DIR/match_false_edges.rs:+2:35: +2:36
- _1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:+2:31: +2:37
- StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
+ StorageDead(_7);
+ FakeRead(ForMatchGuard, _4);
+ FakeRead(ForGuardBinding, _6);
+ StorageLive(_5);
+ _5 = ((_2 as Some).0: i32);
+ StorageLive(_8);
+ _8 = _5;
+ _1 = (const 1_i32, move _8);
+ StorageDead(_8);
+ StorageDead(_5);
+ StorageDead(_6);
+ goto -> bb11;
}
bb8: {
- goto -> bb9; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ goto -> bb9;
}
bb9: {
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37
- falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27
+ StorageDead(_7);
+ StorageDead(_6);
+ falseEdge -> [real: bb3, imaginary: bb1];
}
bb10: {
- _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:+3:17: +3:23
- goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+3:17: +3:23
+ _1 = (const 3_i32, const 3_i32);
+ goto -> bb11;
}
bb11: {
- PlaceMention(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +5:6
- StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7
- _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:29: +6:2
- return; // scope 0 at $DIR/match_false_edges.rs:+6:2: +6:2
+ PlaceMention(_1);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +6:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/match_false_edges.main.built.after.mir b/tests/mir-opt/building/match_false_edges.main.built.after.mir
index 7b8983138..91fe2f90e 100644
--- a/tests/mir-opt/building/match_false_edges.main.built.after.mir
+++ b/tests/mir-opt/building/match_false_edges.main.built.after.mir
@@ -1,175 +1,169 @@
// MIR for `main` after built
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:11: +0:11
- let mut _1: i32; // in scope 0 at $DIR/match_false_edges.rs:+1:13: +6:6
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- let mut _3: isize; // in scope 0 at $DIR/match_false_edges.rs:+4:9: +4:16
- let mut _4: isize; // in scope 0 at $DIR/match_false_edges.rs:+2:9: +2:17
- let mut _5: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- let _6: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- let _7: &i32; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- let mut _8: bool; // in scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
- let _9: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
- let _10: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- let _11: &i32; // in scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- let mut _12: bool; // in scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
- let mut _13: i32; // in scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28
- let _14: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11
+ let mut _0: ();
+ let mut _1: i32;
+ let mut _2: std::option::Option<i32>;
+ let mut _3: isize;
+ let mut _4: isize;
+ let mut _5: &std::option::Option<i32>;
+ let _6: i32;
+ let _7: &i32;
+ let mut _8: bool;
+ let _9: std::option::Option<i32>;
+ let _10: i32;
+ let _11: &i32;
+ let mut _12: bool;
+ let mut _13: i32;
+ let _14: std::option::Option<i32>;
scope 1 {
}
scope 2 {
- debug _w => _6; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:16
- debug _w => _7; // in scope 2 at $DIR/match_false_edges.rs:+2:14: +2:16
+ debug _w => _6;
+ debug _w => _7;
}
scope 3 {
- debug _x => _9; // in scope 3 at $DIR/match_false_edges.rs:+3:9: +3:11
+ debug _x => _9;
}
scope 4 {
- debug y => _10; // in scope 4 at $DIR/match_false_edges.rs:+4:14: +4:15
- debug y => _11; // in scope 4 at $DIR/match_false_edges.rs:+4:14: +4:15
+ debug y => _10;
+ debug y => _11;
}
scope 5 {
- debug _z => _14; // in scope 5 at $DIR/match_false_edges.rs:+5:9: +5:11
+ debug _z => _14;
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +6:6
- StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- _2 = Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- FakeRead(ForMatchedPlace(None), _2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- _4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- switchInt(move _4) -> [1: bb2, otherwise: bb1]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ StorageLive(_1);
+ StorageLive(_2);
+ _2 = Option::<i32>::Some(const 1_i32);
+ FakeRead(ForMatchedPlace(None), _2);
+ _4 = discriminant(_2);
+ switchInt(move _4) -> [1: bb2, otherwise: bb1];
}
bb1: {
- falseEdge -> [real: bb13, imaginary: bb6]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
+ falseEdge -> [real: bb13, imaginary: bb6];
}
bb2: {
- falseEdge -> [real: bb8, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:17
+ falseEdge -> [real: bb8, imaginary: bb1];
}
bb3: {
- goto -> bb1; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ goto -> bb1;
}
bb4: {
- _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- switchInt(move _3) -> [1: bb6, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ _3 = discriminant(_2);
+ switchInt(move _3) -> [1: bb6, otherwise: bb5];
}
bb5: {
- StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11
- _14 = _2; // scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11
- _1 = const 4_i32; // scope 5 at $DIR/match_false_edges.rs:+5:15: +5:16
- StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:+5:15: +5:16
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+5:15: +5:16
+ StorageLive(_14);
+ _14 = _2;
+ _1 = const 4_i32;
+ StorageDead(_14);
+ goto -> bb19;
}
bb6: {
- falseEdge -> [real: bb14, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:+4:9: +4:16
+ falseEdge -> [real: bb14, imaginary: bb5];
}
bb7: {
- goto -> bb5; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26
+ goto -> bb5;
}
bb8: {
- StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _7 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- StorageLive(_8); // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
- _8 = guard() -> [return: bb9, unwind: bb20]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:34:21: 34:26
- // + literal: Const { ty: fn() -> bool {guard}, val: Value(<ZST>) }
+ StorageLive(_7);
+ _7 = &((_2 as Some).0: i32);
+ _5 = &shallow _2;
+ StorageLive(_8);
+ _8 = guard() -> [return: bb9, unwind: bb20];
}
bb9: {
- switchInt(move _8) -> [0: bb11, otherwise: bb10]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
+ switchInt(move _8) -> [0: bb11, otherwise: bb10];
}
bb10: {
- StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _6 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16
- _1 = const 1_i32; // scope 2 at $DIR/match_false_edges.rs:+2:32: +2:33
- StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
+ StorageDead(_8);
+ FakeRead(ForMatchGuard, _5);
+ FakeRead(ForGuardBinding, _7);
+ StorageLive(_6);
+ _6 = ((_2 as Some).0: i32);
+ _1 = const 1_i32;
+ StorageDead(_6);
+ StorageDead(_7);
+ goto -> bb19;
}
bb11: {
- goto -> bb12; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
+ goto -> bb12;
}
bb12: {
- StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28
- StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33
- falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28
+ StorageDead(_8);
+ StorageDead(_7);
+ falseEdge -> [real: bb3, imaginary: bb1];
}
bb13: {
- StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
- _9 = _2; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11
- _1 = const 2_i32; // scope 3 at $DIR/match_false_edges.rs:+3:15: +3:16
- StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+3:15: +3:16
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+3:15: +3:16
+ StorageLive(_9);
+ _9 = _2;
+ _1 = const 2_i32;
+ StorageDead(_9);
+ goto -> bb19;
}
bb14: {
- StorageLive(_11); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _11 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26
- StorageLive(_12); // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
- StorageLive(_13); // scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28
- _13 = (*_11); // scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28
- _12 = guard2(move _13) -> [return: bb15, unwind: bb20]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:36:20: 36:26
- // + literal: Const { ty: fn(i32) -> bool {guard2}, val: Value(<ZST>) }
+ StorageLive(_11);
+ _11 = &((_2 as Some).0: i32);
+ _5 = &shallow _2;
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = (*_11);
+ _12 = guard2(move _13) -> [return: bb15, unwind: bb20];
}
bb15: {
- switchInt(move _12) -> [0: bb17, otherwise: bb16]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
+ switchInt(move _12) -> [0: bb17, otherwise: bb16];
}
bb16: {
- StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- FakeRead(ForGuardBinding, _11); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _10 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15
- _1 = const 3_i32; // scope 4 at $DIR/match_false_edges.rs:+4:33: +4:34
- StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
- StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
- goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
+ StorageDead(_13);
+ StorageDead(_12);
+ FakeRead(ForMatchGuard, _5);
+ FakeRead(ForGuardBinding, _11);
+ StorageLive(_10);
+ _10 = ((_2 as Some).0: i32);
+ _1 = const 3_i32;
+ StorageDead(_10);
+ StorageDead(_11);
+ goto -> bb19;
}
bb17: {
- goto -> bb18; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
+ goto -> bb18;
}
bb18: {
- StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29
- StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34
- falseEdge -> [real: bb7, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_11);
+ falseEdge -> [real: bb7, imaginary: bb5];
}
bb19: {
- PlaceMention(_1); // scope 0 at $DIR/match_false_edges.rs:+1:13: +6:6
- StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+6:6: +6:7
- StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+6:6: +6:7
- _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:11: +7:2
- return; // scope 0 at $DIR/match_false_edges.rs:+7:2: +7:2
+ PlaceMention(_1);
+ StorageDead(_2);
+ StorageDead(_1);
+ _0 = const ();
+ return;
}
bb20 (cleanup): {
- resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +7:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir
index 7a6944dee..fed5e68c3 100644
--- a/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir
+++ b/tests/mir-opt/building/receiver_ptr_mutability.main.built.after.mir
@@ -7,90 +7,81 @@
| 3: user_ty: Canonical { value: Ty(&&&&*mut Test), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: $DIR/receiver_ptr_mutability.rs:18:18: 18:31, inferred_ty: &&&&*mut Test
|
fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/receiver_ptr_mutability.rs:+0:11: +0:11
- let _1: *mut Test as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- let _2: (); // in scope 0 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- let mut _3: *const Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- let mut _4: *mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:8
- let _6: &&&&*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- let _7: &&&*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:35: +5:41
- let _8: &&*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:36: +5:41
- let _9: &*mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+5:37: +5:41
- let _10: (); // in scope 0 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- let mut _11: *const Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- let mut _12: *mut Test; // in scope 0 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
+ let mut _0: ();
+ let _1: *mut Test as UserTypeProjection { base: UserType(0), projs: [] };
+ let _2: ();
+ let mut _3: *const Test;
+ let mut _4: *mut Test;
+ let _6: &&&&*mut Test;
+ let _7: &&&*mut Test;
+ let _8: &&*mut Test;
+ let _9: &*mut Test;
+ let _10: ();
+ let mut _11: *const Test;
+ let mut _12: *mut Test;
scope 1 {
- debug ptr => _1; // in scope 1 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- let _5: &&&&*mut Test as UserTypeProjection { base: UserType(2), projs: [] }; // in scope 1 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
+ debug ptr => _1;
+ let _5: &&&&*mut Test as UserTypeProjection { base: UserType(2), projs: [] };
scope 2 {
- debug ptr_ref => _5; // in scope 2 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
+ debug ptr_ref => _5;
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- _1 = null_mut::<Test>() -> [return: bb1, unwind: bb4]; // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:26: +1:46
- // mir::Constant
- // + span: $DIR/receiver_ptr_mutability.rs:14:26: 14:44
- // + literal: Const { ty: fn() -> *mut Test {null_mut::<Test>}, val: Value(<ZST>) }
+ StorageLive(_1);
+ _1 = null_mut::<Test>() -> [return: bb1, unwind: bb4];
}
bb1: {
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:9: +1:12
- AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/receiver_ptr_mutability.rs:+1:14: +1:23
- StorageLive(_2); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- StorageLive(_3); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- StorageLive(_4); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:8
- _4 = _1; // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:8
- _3 = move _4 as *const Test (Pointer(MutToConstPointer)); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- StorageDead(_4); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:7: +2:8
- _2 = Test::x(move _3) -> [return: bb2, unwind: bb4]; // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:5: +2:12
- // mir::Constant
- // + span: $DIR/receiver_ptr_mutability.rs:15:9: 15:10
- // + literal: Const { ty: fn(*const Test) {Test::x}, val: Value(<ZST>) }
+ FakeRead(ForLet(None), _1);
+ AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] });
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ _4 = _1;
+ _3 = move _4 as *const Test (PointerCoercion(MutToConstPointer));
+ StorageDead(_4);
+ _2 = Test::x(move _3) -> [return: bb2, unwind: bb4];
}
bb2: {
- StorageDead(_3); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:11: +2:12
- StorageDead(_2); // scope 1 at $DIR/receiver_ptr_mutability.rs:+2:12: +2:13
- StorageLive(_5); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
- StorageLive(_6); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- StorageLive(_7); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:35: +5:41
- StorageLive(_8); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:36: +5:41
- StorageLive(_9); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:37: +5:41
- _9 = &_1; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:37: +5:41
- _8 = &_9; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:36: +5:41
- _7 = &_8; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:35: +5:41
- _6 = &_7; // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- _5 = &(*_6); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:34: +5:41
- FakeRead(ForLet(None), _5); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:9: +5:16
- AscribeUserType(_5, o, UserTypeProjection { base: UserType(3), projs: [] }); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:18: +5:31
- StorageDead(_6); // scope 1 at $DIR/receiver_ptr_mutability.rs:+5:41: +5:42
- StorageLive(_10); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- StorageLive(_11); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- StorageLive(_12); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- _12 = (*(*(*(*_5)))); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- _11 = move _12 as *const Test (Pointer(MutToConstPointer)); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- StorageDead(_12); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:11: +6:12
- _10 = Test::x(move _11) -> [return: bb3, unwind: bb4]; // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:5: +6:16
- // mir::Constant
- // + span: $DIR/receiver_ptr_mutability.rs:19:13: 19:14
- // + literal: Const { ty: fn(*const Test) {Test::x}, val: Value(<ZST>) }
+ StorageDead(_3);
+ StorageDead(_2);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ StorageLive(_9);
+ _9 = &_1;
+ _8 = &_9;
+ _7 = &_8;
+ _6 = &_7;
+ _5 = &(*_6);
+ FakeRead(ForLet(None), _5);
+ AscribeUserType(_5, o, UserTypeProjection { base: UserType(3), projs: [] });
+ StorageDead(_6);
+ StorageLive(_10);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = (*(*(*(*_5))));
+ _11 = move _12 as *const Test (PointerCoercion(MutToConstPointer));
+ StorageDead(_12);
+ _10 = Test::x(move _11) -> [return: bb3, unwind: bb4];
}
bb3: {
- StorageDead(_11); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:15: +6:16
- StorageDead(_10); // scope 2 at $DIR/receiver_ptr_mutability.rs:+6:16: +6:17
- _0 = const (); // scope 0 at $DIR/receiver_ptr_mutability.rs:+0:11: +7:2
- StorageDead(_9); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_8); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_7); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_5); // scope 1 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- StorageDead(_1); // scope 0 at $DIR/receiver_ptr_mutability.rs:+7:1: +7:2
- return; // scope 0 at $DIR/receiver_ptr_mutability.rs:+7:2: +7:2
+ StorageDead(_11);
+ StorageDead(_10);
+ _0 = const ();
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
}
bb4 (cleanup): {
- resume; // scope 0 at $DIR/receiver_ptr_mutability.rs:+0:1: +7:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/shifts.shift_signed.built.after.mir b/tests/mir-opt/building/shifts.shift_signed.built.after.mir
index 028777cef..8706ee9d4 100644
--- a/tests/mir-opt/building/shifts.shift_signed.built.after.mir
+++ b/tests/mir-opt/building/shifts.shift_signed.built.after.mir
@@ -1,147 +1,147 @@
// MIR for `shift_signed` after built
fn shift_signed(_1: i8, _2: u128, _3: i8, _4: i32, _5: i128) -> ([i8; 3], [u128; 3]) {
- debug small => _1; // in scope 0 at $DIR/shifts.rs:+0:17: +0:22
- debug big => _2; // in scope 0 at $DIR/shifts.rs:+0:28: +0:31
- debug a => _3; // in scope 0 at $DIR/shifts.rs:+0:39: +0:40
- debug b => _4; // in scope 0 at $DIR/shifts.rs:+0:46: +0:47
- debug c => _5; // in scope 0 at $DIR/shifts.rs:+0:54: +0:55
- let mut _0: ([i8; 3], [u128; 3]); // return place in scope 0 at $DIR/shifts.rs:+0:66: +0:86
- let mut _6: [i8; 3]; // in scope 0 at $DIR/shifts.rs:+2:9: +2:45
- let mut _7: i8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _8: i8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:15
- let mut _9: i8; // in scope 0 at $DIR/shifts.rs:+2:19: +2:20
- let mut _10: u8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _11: bool; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _12: i8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _13: i8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:27
- let mut _14: i32; // in scope 0 at $DIR/shifts.rs:+2:31: +2:32
- let mut _15: u32; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _16: bool; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _17: i8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _18: i8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:39
- let mut _19: i128; // in scope 0 at $DIR/shifts.rs:+2:43: +2:44
- let mut _20: u128; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _21: bool; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _22: [u128; 3]; // in scope 0 at $DIR/shifts.rs:+3:9: +3:39
- let mut _23: u128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _24: u128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:13
- let mut _25: i8; // in scope 0 at $DIR/shifts.rs:+3:17: +3:18
- let mut _26: u8; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _27: bool; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _28: u128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _29: u128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:23
- let mut _30: i32; // in scope 0 at $DIR/shifts.rs:+3:27: +3:28
- let mut _31: u32; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _32: bool; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _33: u128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
- let mut _34: u128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:33
- let mut _35: i128; // in scope 0 at $DIR/shifts.rs:+3:37: +3:38
- let mut _36: u128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
- let mut _37: bool; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ debug small => _1;
+ debug big => _2;
+ debug a => _3;
+ debug b => _4;
+ debug c => _5;
+ let mut _0: ([i8; 3], [u128; 3]);
+ let mut _6: [i8; 3];
+ let mut _7: i8;
+ let mut _8: i8;
+ let mut _9: i8;
+ let mut _10: u8;
+ let mut _11: bool;
+ let mut _12: i8;
+ let mut _13: i8;
+ let mut _14: i32;
+ let mut _15: u32;
+ let mut _16: bool;
+ let mut _17: i8;
+ let mut _18: i8;
+ let mut _19: i128;
+ let mut _20: u128;
+ let mut _21: bool;
+ let mut _22: [u128; 3];
+ let mut _23: u128;
+ let mut _24: u128;
+ let mut _25: i8;
+ let mut _26: u8;
+ let mut _27: bool;
+ let mut _28: u128;
+ let mut _29: u128;
+ let mut _30: i32;
+ let mut _31: u32;
+ let mut _32: bool;
+ let mut _33: u128;
+ let mut _34: u128;
+ let mut _35: i128;
+ let mut _36: u128;
+ let mut _37: bool;
bb0: {
- StorageLive(_6); // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageLive(_7); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageLive(_8); // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- _8 = _1; // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- StorageLive(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _9 = _3; // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _10 = _9 as u8 (IntToInt); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- _11 = Lt(move _10, const 8_u8); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- assert(move _11, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:10: +2:20
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = _1;
+ StorageLive(_9);
+ _9 = _3;
+ _10 = _9 as u8 (IntToInt);
+ _11 = Lt(move _10, const 8_u8);
+ assert(move _11, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7];
}
bb1: {
- _7 = Shr(move _8, move _9); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageDead(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageDead(_8); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageLive(_12); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageLive(_13); // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- _13 = _1; // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- StorageLive(_14); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _14 = _4; // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _15 = _14 as u32 (IntToInt); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- _16 = Lt(move _15, const 8_u32); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- assert(move _16, "attempt to shift right by `{}`, which would overflow", _14) -> [success: bb2, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:22: +2:32
+ _7 = Shr(move _8, move _9);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_12);
+ StorageLive(_13);
+ _13 = _1;
+ StorageLive(_14);
+ _14 = _4;
+ _15 = _14 as u32 (IntToInt);
+ _16 = Lt(move _15, const 8_u32);
+ assert(move _16, "attempt to shift right by `{}`, which would overflow", _14) -> [success: bb2, unwind: bb7];
}
bb2: {
- _12 = Shr(move _13, move _14); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageDead(_14); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageDead(_13); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageLive(_17); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageLive(_18); // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- _18 = _1; // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- StorageLive(_19); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _19 = _5; // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _20 = _19 as u128 (IntToInt); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- _21 = Lt(move _20, const 8_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- assert(move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+ _12 = Shr(move _13, move _14);
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageLive(_17);
+ StorageLive(_18);
+ _18 = _1;
+ StorageLive(_19);
+ _19 = _5;
+ _20 = _19 as u128 (IntToInt);
+ _21 = Lt(move _20, const 8_u128);
+ assert(move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7];
}
bb3: {
- _17 = Shr(move _18, move _19); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageDead(_19); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- StorageDead(_18); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _6 = [move _7, move _12, move _17]; // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageDead(_17); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_12); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_7); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageLive(_22); // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageLive(_23); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageLive(_24); // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- _24 = _2; // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- StorageLive(_25); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _25 = _3; // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _26 = _25 as u8 (IntToInt); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- _27 = Lt(move _26, const 128_u8); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- assert(move _27, "attempt to shift left by `{}`, which would overflow", _25) -> [success: bb4, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:10: +3:18
+ _17 = Shr(move _18, move _19);
+ StorageDead(_19);
+ StorageDead(_18);
+ _6 = [move _7, move _12, move _17];
+ StorageDead(_17);
+ StorageDead(_12);
+ StorageDead(_7);
+ StorageLive(_22);
+ StorageLive(_23);
+ StorageLive(_24);
+ _24 = _2;
+ StorageLive(_25);
+ _25 = _3;
+ _26 = _25 as u8 (IntToInt);
+ _27 = Lt(move _26, const 128_u8);
+ assert(move _27, "attempt to shift left by `{}`, which would overflow", _25) -> [success: bb4, unwind: bb7];
}
bb4: {
- _23 = Shl(move _24, move _25); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageDead(_25); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageDead(_24); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageLive(_28); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageLive(_29); // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- _29 = _2; // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- StorageLive(_30); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _30 = _4; // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _31 = _30 as u32 (IntToInt); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- _32 = Lt(move _31, const 128_u32); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- assert(move _32, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb5, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:20: +3:28
+ _23 = Shl(move _24, move _25);
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageLive(_28);
+ StorageLive(_29);
+ _29 = _2;
+ StorageLive(_30);
+ _30 = _4;
+ _31 = _30 as u32 (IntToInt);
+ _32 = Lt(move _31, const 128_u32);
+ assert(move _32, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb5, unwind: bb7];
}
bb5: {
- _28 = Shl(move _29, move _30); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageDead(_30); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageDead(_29); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageLive(_33); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageLive(_34); // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- _34 = _2; // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- StorageLive(_35); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _35 = _5; // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _36 = _35 as u128 (IntToInt); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- _37 = Lt(move _36, const 128_u128); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- assert(move _37, "attempt to shift left by `{}`, which would overflow", _35) -> [success: bb6, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ _28 = Shl(move _29, move _30);
+ StorageDead(_30);
+ StorageDead(_29);
+ StorageLive(_33);
+ StorageLive(_34);
+ _34 = _2;
+ StorageLive(_35);
+ _35 = _5;
+ _36 = _35 as u128 (IntToInt);
+ _37 = Lt(move _36, const 128_u128);
+ assert(move _37, "attempt to shift left by `{}`, which would overflow", _35) -> [success: bb6, unwind: bb7];
}
bb6: {
- _33 = Shl(move _34, move _35); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageDead(_35); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- StorageDead(_34); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _22 = [move _23, move _28, move _33]; // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageDead(_33); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_28); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_23); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- _0 = (move _6, move _22); // scope 0 at $DIR/shifts.rs:+1:5: +4:6
- StorageDead(_22); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- StorageDead(_6); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- return; // scope 0 at $DIR/shifts.rs:+5:2: +5:2
+ _33 = Shl(move _34, move _35);
+ StorageDead(_35);
+ StorageDead(_34);
+ _22 = [move _23, move _28, move _33];
+ StorageDead(_33);
+ StorageDead(_28);
+ StorageDead(_23);
+ _0 = (move _6, move _22);
+ StorageDead(_22);
+ StorageDead(_6);
+ return;
}
bb7 (cleanup): {
- resume; // scope 0 at $DIR/shifts.rs:+0:1: +5:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
index 04da2d20d..dfd3b5b35 100644
--- a/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
+++ b/tests/mir-opt/building/shifts.shift_unsigned.built.after.mir
@@ -1,135 +1,135 @@
// MIR for `shift_unsigned` after built
fn shift_unsigned(_1: u8, _2: i128, _3: u8, _4: u32, _5: u128) -> ([u8; 3], [i128; 3]) {
- debug small => _1; // in scope 0 at $DIR/shifts.rs:+0:19: +0:24
- debug big => _2; // in scope 0 at $DIR/shifts.rs:+0:30: +0:33
- debug a => _3; // in scope 0 at $DIR/shifts.rs:+0:41: +0:42
- debug b => _4; // in scope 0 at $DIR/shifts.rs:+0:48: +0:49
- debug c => _5; // in scope 0 at $DIR/shifts.rs:+0:56: +0:57
- let mut _0: ([u8; 3], [i128; 3]); // return place in scope 0 at $DIR/shifts.rs:+0:68: +0:88
- let mut _6: [u8; 3]; // in scope 0 at $DIR/shifts.rs:+2:9: +2:45
- let mut _7: u8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _8: u8; // in scope 0 at $DIR/shifts.rs:+2:10: +2:15
- let mut _9: u8; // in scope 0 at $DIR/shifts.rs:+2:19: +2:20
- let mut _10: bool; // in scope 0 at $DIR/shifts.rs:+2:10: +2:20
- let mut _11: u8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _12: u8; // in scope 0 at $DIR/shifts.rs:+2:22: +2:27
- let mut _13: u32; // in scope 0 at $DIR/shifts.rs:+2:31: +2:32
- let mut _14: bool; // in scope 0 at $DIR/shifts.rs:+2:22: +2:32
- let mut _15: u8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _16: u8; // in scope 0 at $DIR/shifts.rs:+2:34: +2:39
- let mut _17: u128; // in scope 0 at $DIR/shifts.rs:+2:43: +2:44
- let mut _18: bool; // in scope 0 at $DIR/shifts.rs:+2:34: +2:44
- let mut _19: [i128; 3]; // in scope 0 at $DIR/shifts.rs:+3:9: +3:39
- let mut _20: i128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _21: i128; // in scope 0 at $DIR/shifts.rs:+3:10: +3:13
- let mut _22: u8; // in scope 0 at $DIR/shifts.rs:+3:17: +3:18
- let mut _23: bool; // in scope 0 at $DIR/shifts.rs:+3:10: +3:18
- let mut _24: i128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _25: i128; // in scope 0 at $DIR/shifts.rs:+3:20: +3:23
- let mut _26: u32; // in scope 0 at $DIR/shifts.rs:+3:27: +3:28
- let mut _27: bool; // in scope 0 at $DIR/shifts.rs:+3:20: +3:28
- let mut _28: i128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
- let mut _29: i128; // in scope 0 at $DIR/shifts.rs:+3:30: +3:33
- let mut _30: u128; // in scope 0 at $DIR/shifts.rs:+3:37: +3:38
- let mut _31: bool; // in scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ debug small => _1;
+ debug big => _2;
+ debug a => _3;
+ debug b => _4;
+ debug c => _5;
+ let mut _0: ([u8; 3], [i128; 3]);
+ let mut _6: [u8; 3];
+ let mut _7: u8;
+ let mut _8: u8;
+ let mut _9: u8;
+ let mut _10: bool;
+ let mut _11: u8;
+ let mut _12: u8;
+ let mut _13: u32;
+ let mut _14: bool;
+ let mut _15: u8;
+ let mut _16: u8;
+ let mut _17: u128;
+ let mut _18: bool;
+ let mut _19: [i128; 3];
+ let mut _20: i128;
+ let mut _21: i128;
+ let mut _22: u8;
+ let mut _23: bool;
+ let mut _24: i128;
+ let mut _25: i128;
+ let mut _26: u32;
+ let mut _27: bool;
+ let mut _28: i128;
+ let mut _29: i128;
+ let mut _30: u128;
+ let mut _31: bool;
bb0: {
- StorageLive(_6); // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageLive(_7); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageLive(_8); // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- _8 = _1; // scope 0 at $DIR/shifts.rs:+2:10: +2:15
- StorageLive(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _9 = _3; // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- _10 = Lt(_9, const 8_u8); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- assert(move _10, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:10: +2:20
+ StorageLive(_6);
+ StorageLive(_7);
+ StorageLive(_8);
+ _8 = _1;
+ StorageLive(_9);
+ _9 = _3;
+ _10 = Lt(_9, const 8_u8);
+ assert(move _10, "attempt to shift right by `{}`, which would overflow", _9) -> [success: bb1, unwind: bb7];
}
bb1: {
- _7 = Shr(move _8, move _9); // scope 0 at $DIR/shifts.rs:+2:10: +2:20
- StorageDead(_9); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageDead(_8); // scope 0 at $DIR/shifts.rs:+2:19: +2:20
- StorageLive(_11); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageLive(_12); // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- _12 = _1; // scope 0 at $DIR/shifts.rs:+2:22: +2:27
- StorageLive(_13); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _13 = _4; // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- _14 = Lt(_13, const 8_u32); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- assert(move _14, "attempt to shift right by `{}`, which would overflow", _13) -> [success: bb2, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:22: +2:32
+ _7 = Shr(move _8, move _9);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageLive(_11);
+ StorageLive(_12);
+ _12 = _1;
+ StorageLive(_13);
+ _13 = _4;
+ _14 = Lt(_13, const 8_u32);
+ assert(move _14, "attempt to shift right by `{}`, which would overflow", _13) -> [success: bb2, unwind: bb7];
}
bb2: {
- _11 = Shr(move _12, move _13); // scope 0 at $DIR/shifts.rs:+2:22: +2:32
- StorageDead(_13); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageDead(_12); // scope 0 at $DIR/shifts.rs:+2:31: +2:32
- StorageLive(_15); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageLive(_16); // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- _16 = _1; // scope 0 at $DIR/shifts.rs:+2:34: +2:39
- StorageLive(_17); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _17 = _5; // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _18 = Lt(_17, const 8_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+ _11 = Shr(move _12, move _13);
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageLive(_15);
+ StorageLive(_16);
+ _16 = _1;
+ StorageLive(_17);
+ _17 = _5;
+ _18 = Lt(_17, const 8_u128);
+ assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7];
}
bb3: {
- _15 = Shr(move _16, move _17); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
- StorageDead(_17); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- StorageDead(_16); // scope 0 at $DIR/shifts.rs:+2:43: +2:44
- _6 = [move _7, move _11, move _15]; // scope 0 at $DIR/shifts.rs:+2:9: +2:45
- StorageDead(_15); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_11); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageDead(_7); // scope 0 at $DIR/shifts.rs:+2:44: +2:45
- StorageLive(_19); // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageLive(_20); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageLive(_21); // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- _21 = _2; // scope 0 at $DIR/shifts.rs:+3:10: +3:13
- StorageLive(_22); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _22 = _3; // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- _23 = Lt(_22, const 128_u8); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- assert(move _23, "attempt to shift left by `{}`, which would overflow", _22) -> [success: bb4, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:10: +3:18
+ _15 = Shr(move _16, move _17);
+ StorageDead(_17);
+ StorageDead(_16);
+ _6 = [move _7, move _11, move _15];
+ StorageDead(_15);
+ StorageDead(_11);
+ StorageDead(_7);
+ StorageLive(_19);
+ StorageLive(_20);
+ StorageLive(_21);
+ _21 = _2;
+ StorageLive(_22);
+ _22 = _3;
+ _23 = Lt(_22, const 128_u8);
+ assert(move _23, "attempt to shift left by `{}`, which would overflow", _22) -> [success: bb4, unwind: bb7];
}
bb4: {
- _20 = Shl(move _21, move _22); // scope 0 at $DIR/shifts.rs:+3:10: +3:18
- StorageDead(_22); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageDead(_21); // scope 0 at $DIR/shifts.rs:+3:17: +3:18
- StorageLive(_24); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageLive(_25); // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- _25 = _2; // scope 0 at $DIR/shifts.rs:+3:20: +3:23
- StorageLive(_26); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _26 = _4; // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- _27 = Lt(_26, const 128_u32); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- assert(move _27, "attempt to shift left by `{}`, which would overflow", _26) -> [success: bb5, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:20: +3:28
+ _20 = Shl(move _21, move _22);
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageLive(_24);
+ StorageLive(_25);
+ _25 = _2;
+ StorageLive(_26);
+ _26 = _4;
+ _27 = Lt(_26, const 128_u32);
+ assert(move _27, "attempt to shift left by `{}`, which would overflow", _26) -> [success: bb5, unwind: bb7];
}
bb5: {
- _24 = Shl(move _25, move _26); // scope 0 at $DIR/shifts.rs:+3:20: +3:28
- StorageDead(_26); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageDead(_25); // scope 0 at $DIR/shifts.rs:+3:27: +3:28
- StorageLive(_28); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageLive(_29); // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- _29 = _2; // scope 0 at $DIR/shifts.rs:+3:30: +3:33
- StorageLive(_30); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _30 = _5; // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _31 = Lt(_30, const 128_u128); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- assert(move _31, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb6, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+3:30: +3:38
+ _24 = Shl(move _25, move _26);
+ StorageDead(_26);
+ StorageDead(_25);
+ StorageLive(_28);
+ StorageLive(_29);
+ _29 = _2;
+ StorageLive(_30);
+ _30 = _5;
+ _31 = Lt(_30, const 128_u128);
+ assert(move _31, "attempt to shift left by `{}`, which would overflow", _30) -> [success: bb6, unwind: bb7];
}
bb6: {
- _28 = Shl(move _29, move _30); // scope 0 at $DIR/shifts.rs:+3:30: +3:38
- StorageDead(_30); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- StorageDead(_29); // scope 0 at $DIR/shifts.rs:+3:37: +3:38
- _19 = [move _20, move _24, move _28]; // scope 0 at $DIR/shifts.rs:+3:9: +3:39
- StorageDead(_28); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_24); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- StorageDead(_20); // scope 0 at $DIR/shifts.rs:+3:38: +3:39
- _0 = (move _6, move _19); // scope 0 at $DIR/shifts.rs:+1:5: +4:6
- StorageDead(_19); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- StorageDead(_6); // scope 0 at $DIR/shifts.rs:+4:5: +4:6
- return; // scope 0 at $DIR/shifts.rs:+5:2: +5:2
+ _28 = Shl(move _29, move _30);
+ StorageDead(_30);
+ StorageDead(_29);
+ _19 = [move _20, move _24, move _28];
+ StorageDead(_28);
+ StorageDead(_24);
+ StorageDead(_20);
+ _0 = (move _6, move _19);
+ StorageDead(_19);
+ StorageDead(_6);
+ return;
}
bb7 (cleanup): {
- resume; // scope 0 at $DIR/shifts.rs:+0:1: +5:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/simple_match.match_bool.built.after.mir b/tests/mir-opt/building/simple_match.match_bool.built.after.mir
index aa2fd4632..c89ea2b6c 100644
--- a/tests/mir-opt/building/simple_match.match_bool.built.after.mir
+++ b/tests/mir-opt/building/simple_match.match_bool.built.after.mir
@@ -1,29 +1,29 @@
// MIR for `match_bool` after built
fn match_bool(_1: bool) -> usize {
- debug x => _1; // in scope 0 at $DIR/simple_match.rs:+0:15: +0:16
- let mut _0: usize; // return place in scope 0 at $DIR/simple_match.rs:+0:27: +0:32
+ debug x => _1;
+ let mut _0: usize;
bb0: {
- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple_match.rs:+1:11: +1:12
- switchInt(_1) -> [0: bb2, otherwise: bb1]; // scope 0 at $DIR/simple_match.rs:+1:5: +1:12
+ FakeRead(ForMatchedPlace(None), _1);
+ switchInt(_1) -> [0: bb2, otherwise: bb1];
}
bb1: {
- falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/simple_match.rs:+2:9: +2:13
+ falseEdge -> [real: bb3, imaginary: bb2];
}
bb2: {
- _0 = const 20_usize; // scope 0 at $DIR/simple_match.rs:+3:14: +3:16
- goto -> bb4; // scope 0 at $DIR/simple_match.rs:+3:14: +3:16
+ _0 = const 20_usize;
+ goto -> bb4;
}
bb3: {
- _0 = const 10_usize; // scope 0 at $DIR/simple_match.rs:+2:17: +2:19
- goto -> bb4; // scope 0 at $DIR/simple_match.rs:+2:17: +2:19
+ _0 = const 10_usize;
+ goto -> bb4;
}
bb4: {
- return; // scope 0 at $DIR/simple_match.rs:+5:2: +5:2
+ return;
}
}
diff --git a/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir
index 1d3f77e07..683f63065 100644
--- a/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir
+++ b/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir
@@ -1,203 +1,200 @@
// MIR for `XXX` after built
static XXX: &Foo = {
- let mut _0: &Foo; // return place in scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:13: +0:25
- let _1: &Foo; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- let _2: Foo; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:29: +18:2
- let mut _3: &[(u32, u32)]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- let mut _4: &[(u32, u32); 42]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- let _5: &[(u32, u32); 42]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- let _6: [(u32, u32); 42]; // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:12: +17:6
- let mut _7: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:9: +3:15
- let mut _8: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:17: +3:23
- let mut _9: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:25: +3:31
- let mut _10: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:9: +4:15
- let mut _11: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:17: +4:23
- let mut _12: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:25: +4:31
- let mut _13: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:9: +5:15
- let mut _14: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:17: +5:23
- let mut _15: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:25: +5:31
- let mut _16: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:9: +6:15
- let mut _17: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:17: +6:23
- let mut _18: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:25: +6:31
- let mut _19: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:9: +7:15
- let mut _20: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:17: +7:23
- let mut _21: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:25: +7:31
- let mut _22: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:9: +8:15
- let mut _23: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:17: +8:23
- let mut _24: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:25: +8:31
- let mut _25: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:9: +9:15
- let mut _26: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:17: +9:23
- let mut _27: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:25: +9:31
- let mut _28: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:9: +10:15
- let mut _29: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:17: +10:23
- let mut _30: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:25: +10:31
- let mut _31: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:9: +11:15
- let mut _32: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:17: +11:23
- let mut _33: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:25: +11:31
- let mut _34: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:9: +12:15
- let mut _35: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:17: +12:23
- let mut _36: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:25: +12:31
- let mut _37: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:9: +13:15
- let mut _38: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:17: +13:23
- let mut _39: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:25: +13:31
- let mut _40: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:9: +14:15
- let mut _41: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:17: +14:23
- let mut _42: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:25: +14:31
- let mut _43: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:9: +15:15
- let mut _44: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:17: +15:23
- let mut _45: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:25: +15:31
- let mut _46: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:9: +16:15
- let mut _47: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:17: +16:23
- let mut _48: (u32, u32); // in scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:25: +16:31
+ let mut _0: &Foo;
+ let _1: &Foo;
+ let _2: Foo;
+ let mut _3: &[(u32, u32)];
+ let mut _4: &[(u32, u32); 42];
+ let _5: &[(u32, u32); 42];
+ let _6: [(u32, u32); 42];
+ let mut _7: (u32, u32);
+ let mut _8: (u32, u32);
+ let mut _9: (u32, u32);
+ let mut _10: (u32, u32);
+ let mut _11: (u32, u32);
+ let mut _12: (u32, u32);
+ let mut _13: (u32, u32);
+ let mut _14: (u32, u32);
+ let mut _15: (u32, u32);
+ let mut _16: (u32, u32);
+ let mut _17: (u32, u32);
+ let mut _18: (u32, u32);
+ let mut _19: (u32, u32);
+ let mut _20: (u32, u32);
+ let mut _21: (u32, u32);
+ let mut _22: (u32, u32);
+ let mut _23: (u32, u32);
+ let mut _24: (u32, u32);
+ let mut _25: (u32, u32);
+ let mut _26: (u32, u32);
+ let mut _27: (u32, u32);
+ let mut _28: (u32, u32);
+ let mut _29: (u32, u32);
+ let mut _30: (u32, u32);
+ let mut _31: (u32, u32);
+ let mut _32: (u32, u32);
+ let mut _33: (u32, u32);
+ let mut _34: (u32, u32);
+ let mut _35: (u32, u32);
+ let mut _36: (u32, u32);
+ let mut _37: (u32, u32);
+ let mut _38: (u32, u32);
+ let mut _39: (u32, u32);
+ let mut _40: (u32, u32);
+ let mut _41: (u32, u32);
+ let mut _42: (u32, u32);
+ let mut _43: (u32, u32);
+ let mut _44: (u32, u32);
+ let mut _45: (u32, u32);
+ let mut _46: (u32, u32);
+ let mut _47: (u32, u32);
+ let mut _48: (u32, u32);
bb0: {
- StorageLive(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- StorageLive(_2); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:29: +18:2
- StorageLive(_3); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageLive(_4); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageLive(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageLive(_6); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:12: +17:6
- StorageLive(_7); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:9: +3:15
- _7 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:9: +3:15
- StorageLive(_8); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:17: +3:23
- _8 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:17: +3:23
- StorageLive(_9); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:25: +3:31
- _9 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+3:25: +3:31
- StorageLive(_10); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:9: +4:15
- _10 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:9: +4:15
- StorageLive(_11); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:17: +4:23
- _11 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:17: +4:23
- StorageLive(_12); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:25: +4:31
- _12 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+4:25: +4:31
- StorageLive(_13); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:9: +5:15
- _13 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:9: +5:15
- StorageLive(_14); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:17: +5:23
- _14 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:17: +5:23
- StorageLive(_15); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:25: +5:31
- _15 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+5:25: +5:31
- StorageLive(_16); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:9: +6:15
- _16 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:9: +6:15
- StorageLive(_17); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:17: +6:23
- _17 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:17: +6:23
- StorageLive(_18); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:25: +6:31
- _18 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+6:25: +6:31
- StorageLive(_19); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:9: +7:15
- _19 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:9: +7:15
- StorageLive(_20); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:17: +7:23
- _20 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:17: +7:23
- StorageLive(_21); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:25: +7:31
- _21 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+7:25: +7:31
- StorageLive(_22); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:9: +8:15
- _22 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:9: +8:15
- StorageLive(_23); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:17: +8:23
- _23 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:17: +8:23
- StorageLive(_24); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:25: +8:31
- _24 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+8:25: +8:31
- StorageLive(_25); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:9: +9:15
- _25 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:9: +9:15
- StorageLive(_26); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:17: +9:23
- _26 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:17: +9:23
- StorageLive(_27); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:25: +9:31
- _27 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+9:25: +9:31
- StorageLive(_28); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:9: +10:15
- _28 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:9: +10:15
- StorageLive(_29); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:17: +10:23
- _29 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:17: +10:23
- StorageLive(_30); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:25: +10:31
- _30 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+10:25: +10:31
- StorageLive(_31); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:9: +11:15
- _31 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:9: +11:15
- StorageLive(_32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:17: +11:23
- _32 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:17: +11:23
- StorageLive(_33); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:25: +11:31
- _33 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+11:25: +11:31
- StorageLive(_34); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:9: +12:15
- _34 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:9: +12:15
- StorageLive(_35); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:17: +12:23
- _35 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:17: +12:23
- StorageLive(_36); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:25: +12:31
- _36 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+12:25: +12:31
- StorageLive(_37); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:9: +13:15
- _37 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:9: +13:15
- StorageLive(_38); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:17: +13:23
- _38 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:17: +13:23
- StorageLive(_39); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:25: +13:31
- _39 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+13:25: +13:31
- StorageLive(_40); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:9: +14:15
- _40 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:9: +14:15
- StorageLive(_41); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:17: +14:23
- _41 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:17: +14:23
- StorageLive(_42); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:25: +14:31
- _42 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+14:25: +14:31
- StorageLive(_43); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:9: +15:15
- _43 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:9: +15:15
- StorageLive(_44); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:17: +15:23
- _44 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:17: +15:23
- StorageLive(_45); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:25: +15:31
- _45 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+15:25: +15:31
- StorageLive(_46); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:9: +16:15
- _46 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:9: +16:15
- StorageLive(_47); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:17: +16:23
- _47 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:17: +16:23
- StorageLive(_48); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:25: +16:31
- _48 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+16:25: +16:31
- _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48]; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:12: +17:6
- StorageDead(_48); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_47); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_46); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_45); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_44); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_43); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_42); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_41); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_40); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_39); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_38); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_37); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_36); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_35); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_34); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_33); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_31); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_30); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_29); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_28); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_27); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_26); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_25); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_24); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_23); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_22); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_21); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_20); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_19); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_18); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_17); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_16); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_15); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_14); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_13); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_12); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_11); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_10); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_9); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_8); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- StorageDead(_7); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- _5 = &_6; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- _4 = &(*_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- _3 = move _4 as &[(u32, u32)] (Pointer(Unsize)); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+2:11: +17:6
- StorageDead(_4); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+17:5: +17:6
- _2 = Foo { tup: const "hi", data: move _3 }; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:29: +18:2
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:6:10: 6:14
- // + literal: Const { ty: &str, val: Value(Slice(..)) }
- StorageDead(_3); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
- _1 = &_2; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- _0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
- StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
- StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
- return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:1: +18:3
+ StorageLive(_1);
+ StorageLive(_2);
+ StorageLive(_3);
+ StorageLive(_4);
+ StorageLive(_5);
+ StorageLive(_6);
+ StorageLive(_7);
+ _7 = (const 0_u32, const 1_u32);
+ StorageLive(_8);
+ _8 = (const 0_u32, const 2_u32);
+ StorageLive(_9);
+ _9 = (const 0_u32, const 3_u32);
+ StorageLive(_10);
+ _10 = (const 0_u32, const 1_u32);
+ StorageLive(_11);
+ _11 = (const 0_u32, const 2_u32);
+ StorageLive(_12);
+ _12 = (const 0_u32, const 3_u32);
+ StorageLive(_13);
+ _13 = (const 0_u32, const 1_u32);
+ StorageLive(_14);
+ _14 = (const 0_u32, const 2_u32);
+ StorageLive(_15);
+ _15 = (const 0_u32, const 3_u32);
+ StorageLive(_16);
+ _16 = (const 0_u32, const 1_u32);
+ StorageLive(_17);
+ _17 = (const 0_u32, const 2_u32);
+ StorageLive(_18);
+ _18 = (const 0_u32, const 3_u32);
+ StorageLive(_19);
+ _19 = (const 0_u32, const 1_u32);
+ StorageLive(_20);
+ _20 = (const 0_u32, const 2_u32);
+ StorageLive(_21);
+ _21 = (const 0_u32, const 3_u32);
+ StorageLive(_22);
+ _22 = (const 0_u32, const 1_u32);
+ StorageLive(_23);
+ _23 = (const 0_u32, const 2_u32);
+ StorageLive(_24);
+ _24 = (const 0_u32, const 3_u32);
+ StorageLive(_25);
+ _25 = (const 0_u32, const 1_u32);
+ StorageLive(_26);
+ _26 = (const 0_u32, const 2_u32);
+ StorageLive(_27);
+ _27 = (const 0_u32, const 3_u32);
+ StorageLive(_28);
+ _28 = (const 0_u32, const 1_u32);
+ StorageLive(_29);
+ _29 = (const 0_u32, const 2_u32);
+ StorageLive(_30);
+ _30 = (const 0_u32, const 3_u32);
+ StorageLive(_31);
+ _31 = (const 0_u32, const 1_u32);
+ StorageLive(_32);
+ _32 = (const 0_u32, const 2_u32);
+ StorageLive(_33);
+ _33 = (const 0_u32, const 3_u32);
+ StorageLive(_34);
+ _34 = (const 0_u32, const 1_u32);
+ StorageLive(_35);
+ _35 = (const 0_u32, const 2_u32);
+ StorageLive(_36);
+ _36 = (const 0_u32, const 3_u32);
+ StorageLive(_37);
+ _37 = (const 0_u32, const 1_u32);
+ StorageLive(_38);
+ _38 = (const 0_u32, const 2_u32);
+ StorageLive(_39);
+ _39 = (const 0_u32, const 3_u32);
+ StorageLive(_40);
+ _40 = (const 0_u32, const 1_u32);
+ StorageLive(_41);
+ _41 = (const 0_u32, const 2_u32);
+ StorageLive(_42);
+ _42 = (const 0_u32, const 3_u32);
+ StorageLive(_43);
+ _43 = (const 0_u32, const 1_u32);
+ StorageLive(_44);
+ _44 = (const 0_u32, const 2_u32);
+ StorageLive(_45);
+ _45 = (const 0_u32, const 3_u32);
+ StorageLive(_46);
+ _46 = (const 0_u32, const 1_u32);
+ StorageLive(_47);
+ _47 = (const 0_u32, const 2_u32);
+ StorageLive(_48);
+ _48 = (const 0_u32, const 3_u32);
+ _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48];
+ StorageDead(_48);
+ StorageDead(_47);
+ StorageDead(_46);
+ StorageDead(_45);
+ StorageDead(_44);
+ StorageDead(_43);
+ StorageDead(_42);
+ StorageDead(_41);
+ StorageDead(_40);
+ StorageDead(_39);
+ StorageDead(_38);
+ StorageDead(_37);
+ StorageDead(_36);
+ StorageDead(_35);
+ StorageDead(_34);
+ StorageDead(_33);
+ StorageDead(_32);
+ StorageDead(_31);
+ StorageDead(_30);
+ StorageDead(_29);
+ StorageDead(_28);
+ StorageDead(_27);
+ StorageDead(_26);
+ StorageDead(_25);
+ StorageDead(_24);
+ StorageDead(_23);
+ StorageDead(_22);
+ StorageDead(_21);
+ StorageDead(_20);
+ StorageDead(_19);
+ StorageDead(_18);
+ StorageDead(_17);
+ StorageDead(_16);
+ StorageDead(_15);
+ StorageDead(_14);
+ StorageDead(_13);
+ StorageDead(_12);
+ StorageDead(_11);
+ StorageDead(_10);
+ StorageDead(_9);
+ StorageDead(_8);
+ StorageDead(_7);
+ _5 = &_6;
+ _4 = &(*_5);
+ _3 = move _4 as &[(u32, u32)] (PointerCoercion(Unsize));
+ StorageDead(_4);
+ _2 = Foo { tup: const "hi", data: move _3 };
+ StorageDead(_3);
+ _1 = &_2;
+ _0 = &(*_1);
+ StorageDead(_5);
+ StorageDead(_1);
+ return;
}
}
diff --git a/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir
index 54f0ea2d8..fea1138ba 100644
--- a/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir
+++ b/tests/mir-opt/building/uniform_array_move_out.move_out_by_subslice.built.after.mir
@@ -1,23 +1,23 @@
// MIR for `move_out_by_subslice` after built
fn move_out_by_subslice() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:+0:27: +0:27
- let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
+ let mut _0: ();
+ let _1: [std::boxed::Box<i32>; 2];
+ let mut _2: std::boxed::Box<i32>;
+ let mut _3: usize;
+ let mut _4: usize;
+ let mut _5: *mut u8;
+ let mut _6: std::boxed::Box<i32>;
+ let mut _7: std::boxed::Box<i32>;
+ let mut _8: usize;
+ let mut _9: usize;
+ let mut _10: *mut u8;
+ let mut _11: std::boxed::Box<i32>;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let _12: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
+ debug a => _1;
+ let _12: [std::boxed::Box<i32>; 2];
scope 4 {
- debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
+ debug _y => _12;
}
}
scope 2 {
@@ -26,87 +26,81 @@ fn move_out_by_subslice() -> () {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:18:9: 18:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+ _3 = SizeOf(i32);
+ _4 = AlignOf(i32);
+ _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12];
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- (*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+3:18: +3:19
- _2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
+ StorageLive(_6);
+ _6 = ShallowInitBox(move _5, i32);
+ (*_6) = const 1_i32;
+ _2 = move _6;
+ drop(_6) -> [return: bb2, unwind: bb11];
}
bb2: {
- StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
- StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:20:9: 20:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageDead(_6);
+ StorageLive(_7);
+ _8 = SizeOf(i32);
+ _9 = AlignOf(i32);
+ _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11];
}
bb3: {
- StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- (*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+5:18: +5:19
- _7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
+ StorageLive(_11);
+ _11 = ShallowInitBox(move _10, i32);
+ (*_11) = const 2_i32;
+ _7 = move _11;
+ drop(_11) -> [return: bb4, unwind: bb10];
}
bb4: {
- StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
- _1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:13: +6:6
- drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_11);
+ _1 = [move _2, move _7];
+ drop(_7) -> [return: bb5, unwind: bb11];
}
bb5: {
- StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_7);
+ drop(_2) -> [return: bb6, unwind: bb12];
}
bb6: {
- StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- PlaceMention(_1); // scope 1 at $DIR/uniform_array_move_out.rs:+7:21: +7:22
- StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
- _12 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:+7:10: +7:12
- _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:+0:27: +8:2
- drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_2);
+ FakeRead(ForLet(None), _1);
+ PlaceMention(_1);
+ StorageLive(_12);
+ _12 = move _1[0..2];
+ _0 = const ();
+ drop(_12) -> [return: bb7, unwind: bb9];
}
bb7: {
- StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_12);
+ drop(_1) -> [return: bb8, unwind: bb12];
}
bb8: {
- StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- return; // scope 0 at $DIR/uniform_array_move_out.rs:+8:2: +8:2
+ StorageDead(_1);
+ return;
}
bb9 (cleanup): {
- drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ drop(_1) -> [return: bb12, unwind terminate];
}
bb10 (cleanup): {
- drop(_7) -> [return: bb11, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_7) -> [return: bb11, unwind terminate];
}
bb11 (cleanup): {
- drop(_2) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_2) -> [return: bb12, unwind terminate];
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +8:2
+ resume;
}
}
diff --git a/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir
index 5090a4ba6..3def40a85 100644
--- a/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir
+++ b/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir
@@ -1,23 +1,23 @@
// MIR for `move_out_from_end` after built
fn move_out_from_end() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/uniform_array_move_out.rs:+0:24: +0:24
- let _1: [std::boxed::Box<i32>; 2]; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let mut _2: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _3: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _4: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _5: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _6: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- let mut _7: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _8: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _9: usize; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _10: *mut u8; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
+ let mut _0: ();
+ let _1: [std::boxed::Box<i32>; 2];
+ let mut _2: std::boxed::Box<i32>;
+ let mut _3: usize;
+ let mut _4: usize;
+ let mut _5: *mut u8;
+ let mut _6: std::boxed::Box<i32>;
+ let mut _7: std::boxed::Box<i32>;
+ let mut _8: usize;
+ let mut _9: usize;
+ let mut _10: *mut u8;
+ let mut _11: std::boxed::Box<i32>;
scope 1 {
- debug a => _1; // in scope 1 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- let _12: std::boxed::Box<i32>; // in scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
+ debug a => _1;
+ let _12: std::boxed::Box<i32>;
scope 4 {
- debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
+ debug _y => _12;
}
}
scope 2 {
@@ -26,87 +26,81 @@ fn move_out_from_end() -> () {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- StorageLive(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _3 = SizeOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _4 = AlignOf(i32); // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:7:9: 7:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageLive(_1);
+ StorageLive(_2);
+ _3 = SizeOf(i32);
+ _4 = AlignOf(i32);
+ _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12];
}
bb1: {
- StorageLive(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- _6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- (*_6) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+3:18: +3:19
- _2 = move _6; // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
- drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
+ StorageLive(_6);
+ _6 = ShallowInitBox(move _5, i32);
+ (*_6) = const 1_i32;
+ _2 = move _6;
+ drop(_6) -> [return: bb2, unwind: bb11];
}
bb2: {
- StorageDead(_6); // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
- StorageLive(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _8 = SizeOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _9 = AlignOf(i32); // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:9:9: 9:20
- // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
+ StorageDead(_6);
+ StorageLive(_7);
+ _8 = SizeOf(i32);
+ _9 = AlignOf(i32);
+ _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11];
}
bb3: {
- StorageLive(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- _11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- (*_11) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:+5:18: +5:19
- _7 = move _11; // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
- drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
+ StorageLive(_11);
+ _11 = ShallowInitBox(move _10, i32);
+ (*_11) = const 2_i32;
+ _7 = move _11;
+ drop(_11) -> [return: bb4, unwind: bb10];
}
bb4: {
- StorageDead(_11); // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
- _1 = [move _2, move _7]; // scope 0 at $DIR/uniform_array_move_out.rs:+1:13: +6:6
- drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_11);
+ _1 = [move _2, move _7];
+ drop(_7) -> [return: bb5, unwind: bb11];
}
bb5: {
- StorageDead(_7); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ StorageDead(_7);
+ drop(_2) -> [return: bb6, unwind: bb12];
}
bb6: {
- StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
- FakeRead(ForLet(None), _1); // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
- PlaceMention(_1); // scope 1 at $DIR/uniform_array_move_out.rs:+7:20: +7:21
- StorageLive(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
- _12 = move _1[1 of 2]; // scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
- _0 = const (); // scope 0 at $DIR/uniform_array_move_out.rs:+0:24: +8:2
- drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_2);
+ FakeRead(ForLet(None), _1);
+ PlaceMention(_1);
+ StorageLive(_12);
+ _12 = move _1[1 of 2];
+ _0 = const ();
+ drop(_12) -> [return: bb7, unwind: bb9];
}
bb7: {
- StorageDead(_12); // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ StorageDead(_12);
+ drop(_1) -> [return: bb8, unwind: bb12];
}
bb8: {
- StorageDead(_1); // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
- return; // scope 0 at $DIR/uniform_array_move_out.rs:+8:2: +8:2
+ StorageDead(_1);
+ return;
}
bb9 (cleanup): {
- drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
+ drop(_1) -> [return: bb12, unwind terminate];
}
bb10 (cleanup): {
- drop(_7) -> [return: bb11, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_7) -> [return: bb11, unwind terminate];
}
bb11 (cleanup): {
- drop(_2) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
+ drop(_2) -> [return: bb12, unwind terminate];
}
bb12 (cleanup): {
- resume; // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +8:2
+ resume;
}
}