1 // MIR for `main` after SimplifyCfg-elaborate-drops
4 let mut _0: (); // return place in scope 0 at $DIR/array-index-is-temporary.rs:12:11: 12:11
5 let mut _1: [u32; 3]; // in scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
6 let mut _4: &mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:15:25: 15:31
7 let mut _5: u32; // in scope 0 at $DIR/array-index-is-temporary.rs:16:12: 16:29
8 let mut _6: *mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:16:25: 16:26
9 let _7: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:16:7: 16:8
10 let mut _8: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:16:5: 16:9
11 let mut _9: bool; // in scope 0 at $DIR/array-index-is-temporary.rs:16:5: 16:9
13 debug x => _1; // in scope 1 at $DIR/array-index-is-temporary.rs:13:9: 13:14
14 let mut _2: usize; // in scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
16 debug y => _2; // in scope 2 at $DIR/array-index-is-temporary.rs:14:9: 14:14
17 let _3: *mut usize; // in scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
19 debug z => _3; // in scope 3 at $DIR/array-index-is-temporary.rs:15:9: 15:10
27 StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
28 _1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
31 // + val: Value(Scalar(0x0000002a))
33 // + span: $DIR/array-index-is-temporary.rs:13:18: 13:20
34 // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
37 // + val: Value(Scalar(0x0000002b))
39 // + span: $DIR/array-index-is-temporary.rs:13:22: 13:24
40 // + literal: Const { ty: u32, val: Value(Scalar(0x0000002b)) }
43 // + val: Value(Scalar(0x0000002c))
45 // + span: $DIR/array-index-is-temporary.rs:13:26: 13:28
46 // + literal: Const { ty: u32, val: Value(Scalar(0x0000002c)) }
47 StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
48 _2 = const 1_usize; // scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
51 // + val: Value(Scalar(0x0000000000000001))
53 // + span: $DIR/array-index-is-temporary.rs:14:17: 14:18
54 // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
55 StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
56 StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
57 _4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
58 _3 = &raw mut (*_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
59 StorageDead(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
60 StorageLive(_5); // scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
61 StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
62 _6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
63 _5 = const foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
65 // + ty: unsafe fn(*mut usize) -> u32 {foo}
66 // + val: Value(Scalar(<ZST>))
68 // + span: $DIR/array-index-is-temporary.rs:16:21: 16:24
69 // + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(Scalar(<ZST>)) }
73 StorageDead(_6); // scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
74 StorageLive(_7); // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
75 _7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
76 _8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
77 _9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
78 assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
82 _1[_7] = move _5; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
83 StorageDead(_5); // scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
84 StorageDead(_7); // scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
85 _0 = const (); // scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
88 // + val: Value(Scalar(<ZST>))
90 // + span: $DIR/array-index-is-temporary.rs:12:11: 17:2
91 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
92 StorageDead(_3); // scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
93 StorageDead(_2); // scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
94 StorageDead(_1); // scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
95 return; // scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2