File: gvn.repeated_index.GVN.panic-abort.diff

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (82 lines) | stat: -rw-r--r-- 2,504 bytes parent folder | download | duplicates (2)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
- // MIR for `repeated_index` before GVN
+ // MIR for `repeated_index` after GVN
  
  fn repeated_index(_1: T, _2: usize) -> () {
      debug x => _1;
      debug idx => _2;
      let mut _0: ();
      let _3: [T; N];
      let mut _4: T;
      let _5: ();
      let mut _6: T;
      let _7: usize;
      let mut _8: usize;
      let mut _9: bool;
      let _10: ();
      let mut _11: T;
      let _12: usize;
      let mut _13: usize;
      let mut _14: bool;
      scope 1 {
          debug a => _3;
      }
  
      bb0: {
          StorageLive(_3);
          StorageLive(_4);
          _4 = copy _1;
-         _3 = [move _4; N];
+         _3 = [copy _1; N];
          StorageDead(_4);
          StorageLive(_5);
          StorageLive(_6);
          StorageLive(_7);
          _7 = const 0_usize;
-         _8 = Len(_3);
-         _9 = Lt(copy _7, copy _8);
-         assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, copy _7) -> [success: bb1, unwind unreachable];
+         _8 = const N;
+         _9 = Lt(const 0_usize, const N);
+         assert(move _9, "index out of bounds: the length is {} but the index is {}", const N, const 0_usize) -> [success: bb1, unwind unreachable];
      }
  
      bb1: {
-         _6 = copy _3[_7];
-         _5 = opaque::<T>(move _6) -> [return: bb2, unwind unreachable];
+         _6 = copy _1;
+         _5 = opaque::<T>(copy _1) -> [return: bb2, unwind unreachable];
      }
  
      bb2: {
          StorageDead(_6);
          StorageDead(_7);
          StorageDead(_5);
          StorageLive(_10);
          StorageLive(_11);
          StorageLive(_12);
          _12 = copy _2;
-         _13 = Len(_3);
-         _14 = Lt(copy _12, copy _13);
-         assert(move _14, "index out of bounds: the length is {} but the index is {}", move _13, copy _12) -> [success: bb3, unwind unreachable];
+         _13 = const N;
+         _14 = Lt(copy _2, const N);
+         assert(move _14, "index out of bounds: the length is {} but the index is {}", const N, copy _2) -> [success: bb3, unwind unreachable];
      }
  
      bb3: {
-         _11 = copy _3[_12];
-         _10 = opaque::<T>(move _11) -> [return: bb4, unwind unreachable];
+         _11 = copy _1;
+         _10 = opaque::<T>(copy _1) -> [return: bb4, unwind unreachable];
      }
  
      bb4: {
          StorageDead(_11);
          StorageDead(_12);
          StorageDead(_10);
          _0 = const ();
          StorageDead(_3);
          return;
      }
  }