Logic mapped across each use of a `LocalId`.
(expr: &MirRelationExpr, mut logic: F)
| 223 | |
| 224 | /// Logic mapped across each use of a `LocalId`. |
| 225 | pub(super) fn for_local_id<F>(expr: &MirRelationExpr, mut logic: F) |
| 226 | where |
| 227 | F: FnMut(LocalId), |
| 228 | { |
| 229 | expr.visit_pre(|expr| { |
| 230 | if let MirRelationExpr::Get { |
| 231 | id: Id::Local(i), .. |
| 232 | } = expr |
| 233 | { |
| 234 | logic(*i); |
| 235 | } |
| 236 | }); |
| 237 | } |
| 238 | |
| 239 | /// Populates `counts` with the number of uses of each local identifier in `expr`. |
| 240 | pub(super) fn count_local_id_uses( |
no test coverage detected