summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals-before-const-prop.diff
blob: 9ff32b26b77edb8b68ac70ecc9ca4226bcb53520 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
- // MIR for `map` before SimplifyLocals-before-const-prop
+ // MIR for `map` after SimplifyLocals-before-const-prop
  
  fn map(_1: Option<Box<()>>) -> Option<Box<()>> {
      debug x => _1;
      let mut _0: std::option::Option<std::boxed::Box<()>>;
      let mut _2: isize;
      let _3: std::boxed::Box<()>;
      let mut _4: std::boxed::Box<()>;
-     let mut _5: bool;
-     let mut _6: isize;
-     let mut _7: isize;
      scope 1 {
          debug x => _3;
      }
  
      bb0: {
-         _5 = const false;
-         _5 = const true;
          _2 = discriminant(_1);
          switchInt(move _2) -> [0: bb3, 1: bb1, otherwise: bb2];
      }
  
      bb1: {
          StorageLive(_3);
          _3 = move ((_1 as Some).0: std::boxed::Box<()>);
          StorageLive(_4);
          _4 = move _3;
          _0 = Option::<Box<()>>::Some(move _4);
          StorageDead(_4);
          StorageDead(_3);
          goto -> bb4;
      }
  
      bb2: {
          unreachable;
      }
  
      bb3: {
          _0 = Option::<Box<()>>::None;
          goto -> bb4;
      }
  
      bb4: {
-         _6 = discriminant(_1);
          return;
      }
  }