summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/dataflow-const-prop/enum.mutate_discriminant.DataflowConstProp.diff
blob: 038e6c6bd900596a0ca54886a4f1c9e89c8c0133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
- // MIR for `mutate_discriminant` before DataflowConstProp
+ // MIR for `mutate_discriminant` after DataflowConstProp
  
  fn mutate_discriminant() -> u8 {
      let mut _0: u8;                      // return place in scope 0 at $DIR/enum.rs:+0:29: +0:31
      let mut _1: std::option::Option<NonZeroUsize>; // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
      let mut _2: isize;                   // in scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
  
      bb0: {
          discriminant(_1) = 1;            // scope 0 at $DIR/enum.rs:+4:13: +4:34
          (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; // scope 0 at $DIR/enum.rs:+6:13: +6:64
          _2 = discriminant(_1);           // scope 0 at $SRC_DIR/core/src/intrinsics/mir.rs:LL:COL
          switchInt(_2) -> [0: bb1, otherwise: bb2]; // scope 0 at $DIR/enum.rs:+9:13: +12:14
      }
  
      bb1: {
          _0 = const 1_u8;                 // scope 0 at $DIR/enum.rs:+15:13: +15:20
          return;                          // scope 0 at $DIR/enum.rs:+16:13: +16:21
      }
  
      bb2: {
          _0 = const 2_u8;                 // scope 0 at $DIR/enum.rs:+19:13: +19:20
          unreachable;                     // scope 0 at $DIR/enum.rs:+20:13: +20:26
      }
  }