Determines if a loop is contained in another loop. `is_child_loop(child,parent)` returns `true` if and only if `child` is a child loop of `parent` (or `child == parent`).
(&self, child: Loop, parent: Loop)
| 142 | /// `is_child_loop(child,parent)` returns `true` if and only if `child` is a child loop of |
| 143 | /// `parent` (or `child == parent`). |
| 144 | pub fn is_child_loop(&self, child: Loop, parent: Loop) -> bool { |
| 145 | let mut finger = Some(child); |
| 146 | while let Some(finger_loop) = finger { |
| 147 | if finger_loop == parent { |
| 148 | return true; |
| 149 | } |
| 150 | finger = self.loop_parent(finger_loop); |
| 151 | } |
| 152 | false |
| 153 | } |
| 154 | |
| 155 | /// Returns the loop-nest level of a given block. |
| 156 | pub fn loop_level(&self, block: Block) -> LoopLevel { |