]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/issue_101973.inner.ConstProp.diff
Add #[const_trait] where needed in tests.
[rust.git] / src / test / mir-opt / issue_101973.inner.ConstProp.diff
1 - // MIR for `inner` before ConstProp
2 + // MIR for `inner` after ConstProp
3   
4   fn inner(_1: u32) -> i64 {
5       debug fields => _1;                  // in scope 0 at $DIR/issue_101973.rs:+0:14: +0:20
6       let mut _0: i64;                     // return place in scope 0 at $DIR/issue_101973.rs:+0:30: +0:33
7       let mut _2: i32;                     // in scope 0 at $DIR/issue_101973.rs:+1:5: +1:65
8       let mut _3: u32;                     // in scope 0 at $DIR/issue_101973.rs:+1:5: +1:58
9       let mut _4: u32;                     // in scope 0 at $DIR/issue_101973.rs:+1:5: +1:17
10       let mut _5: u32;                     // in scope 0 at $DIR/issue_101973.rs:+1:10: +1:16
11       let mut _6: u32;                     // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
12       let mut _7: u32;                     // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:52
13       let mut _8: u32;                     // in scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
14       let mut _9: u32;                     // in scope 0 at $DIR/issue_101973.rs:+1:33: +1:39
15       let mut _10: (u32, bool);            // in scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
16       let mut _11: (u32, bool);            // in scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
17       scope 1 (inlined imm8) {             // at $DIR/issue_101973.rs:14:5: 14:17
18           debug x => _5;                   // in scope 1 at $DIR/issue_101973.rs:5:13: 5:14
19           let mut _12: u32;                // in scope 1 at $DIR/issue_101973.rs:7:12: 7:27
20           let mut _13: u32;                // in scope 1 at $DIR/issue_101973.rs:7:12: 7:20
21           let mut _14: u32;                // in scope 1 at $DIR/issue_101973.rs:7:13: 7:14
22           let mut _15: (u32, bool);        // in scope 1 at $DIR/issue_101973.rs:7:12: 7:20
23           scope 2 {
24               debug out => _4;             // in scope 2 at $DIR/issue_101973.rs:6:9: 6:16
25           }
26       }
27       scope 3 (inlined core::num::<impl u32>::rotate_right) { // at $DIR/issue_101973.rs:14:5: 14:58
28           debug self => _4;                // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
29           debug n => _6;                   // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
30           let mut _16: u32;                // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
31           let mut _17: u32;                // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
32       }
33   
34       bb0: {
35           StorageLive(_2);                 // scope 0 at $DIR/issue_101973.rs:+1:5: +1:65
36           StorageLive(_3);                 // scope 0 at $DIR/issue_101973.rs:+1:5: +1:58
37           StorageLive(_4);                 // scope 0 at $DIR/issue_101973.rs:+1:5: +1:17
38           StorageLive(_5);                 // scope 0 at $DIR/issue_101973.rs:+1:10: +1:16
39           _5 = _1;                         // scope 0 at $DIR/issue_101973.rs:+1:10: +1:16
40           _4 = const 0_u32;                // scope 1 at $DIR/issue_101973.rs:6:19: 6:23
41           StorageLive(_12);                // scope 2 at $DIR/issue_101973.rs:7:12: 7:27
42           StorageLive(_13);                // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
43           StorageLive(_14);                // scope 2 at $DIR/issue_101973.rs:7:13: 7:14
44           _14 = _5;                        // scope 2 at $DIR/issue_101973.rs:7:13: 7:14
45           _15 = CheckedShr(_14, const 0_i32); // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
46           assert(!move (_15.1: bool), "attempt to shift right by `{}`, which would overflow", const 0_i32) -> bb3; // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
47       }
48   
49       bb1: {
50           _8 = move (_10.0: u32);          // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
51           StorageDead(_9);                 // scope 0 at $DIR/issue_101973.rs:+1:44: +1:45
52           _7 = BitAnd(move _8, const 15_u32); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:52
53           StorageDead(_8);                 // scope 0 at $DIR/issue_101973.rs:+1:51: +1:52
54           _11 = CheckedShl(_7, const 1_i32); // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
55           assert(!move (_11.1: bool), "attempt to shift left by `{}`, which would overflow", const 1_i32) -> bb2; // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
56       }
57   
58       bb2: {
59           _6 = move (_11.0: u32);          // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
60           StorageDead(_7);                 // scope 0 at $DIR/issue_101973.rs:+1:56: +1:57
61           StorageLive(_16);                // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
62           _16 = _4;                        // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
63           StorageLive(_17);                // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
64           _17 = _6;                        // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
65           _3 = rotate_right::<u32>(move _16, move _17) -> bb4; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
66                                            // mir::Constant
67                                            // + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
68                                            // + literal: Const { ty: extern "rust-intrinsic" fn(u32, u32) -> u32 {rotate_right::<u32>}, val: Value(<ZST>) }
69       }
70   
71       bb3: {
72           _13 = move (_15.0: u32);         // scope 2 at $DIR/issue_101973.rs:7:12: 7:20
73           StorageDead(_14);                // scope 2 at $DIR/issue_101973.rs:7:19: 7:20
74           _12 = BitAnd(move _13, const 255_u32); // scope 2 at $DIR/issue_101973.rs:7:12: 7:27
75           StorageDead(_13);                // scope 2 at $DIR/issue_101973.rs:7:26: 7:27
76           _4 = BitOr(_4, move _12);        // scope 2 at $DIR/issue_101973.rs:7:5: 7:27
77           StorageDead(_12);                // scope 2 at $DIR/issue_101973.rs:7:26: 7:27
78           StorageDead(_5);                 // scope 0 at $DIR/issue_101973.rs:+1:16: +1:17
79           StorageLive(_6);                 // scope 0 at $DIR/issue_101973.rs:+1:31: +1:57
80           StorageLive(_7);                 // scope 0 at $DIR/issue_101973.rs:+1:31: +1:52
81           StorageLive(_8);                 // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
82           StorageLive(_9);                 // scope 0 at $DIR/issue_101973.rs:+1:33: +1:39
83           _9 = _1;                         // scope 0 at $DIR/issue_101973.rs:+1:33: +1:39
84           _10 = CheckedShr(_9, const 8_i32); // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
85           assert(!move (_10.1: bool), "attempt to shift right by `{}`, which would overflow", const 8_i32) -> bb1; // scope 0 at $DIR/issue_101973.rs:+1:32: +1:45
86       }
87   
88       bb4: {
89           StorageDead(_17);                // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
90           StorageDead(_16);                // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
91           StorageDead(_6);                 // scope 0 at $DIR/issue_101973.rs:+1:57: +1:58
92           StorageDead(_4);                 // scope 0 at $DIR/issue_101973.rs:+1:57: +1:58
93           _2 = move _3 as i32 (IntToInt);  // scope 0 at $DIR/issue_101973.rs:+1:5: +1:65
94           StorageDead(_3);                 // scope 0 at $DIR/issue_101973.rs:+1:64: +1:65
95           _0 = move _2 as i64 (IntToInt);  // scope 0 at $DIR/issue_101973.rs:+1:5: +1:72
96           StorageDead(_2);                 // scope 0 at $DIR/issue_101973.rs:+1:71: +1:72
97           return;                          // scope 0 at $DIR/issue_101973.rs:+2:2: +2:2
98       }
99   }
100