(&mut self, node: Node<'t>, depth: u32, walked: &[usize])
| 1280 | } |
| 1281 | |
| 1282 | fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &[usize]) { |
| 1283 | stack_guard!(); |
| 1284 | if depth > 12 { |
| 1285 | return; |
| 1286 | } |
| 1287 | // Subtrees the body walker has already been through. |
| 1288 | if walked.contains(&node.id()) { |
| 1289 | return; |
| 1290 | } |
| 1291 | // (functionTypes is empty for Java; lambda_expression halts the scan) |
| 1292 | if depth > 0 && matches!(node.kind(), "lambda_literal" | "lambda_expression") { |
| 1293 | return; |
| 1294 | } |
| 1295 | self.maybe_capture_fn_refs(node); |
| 1296 | for i in 0..node.named_child_count() { |
| 1297 | if let Some(c) = node.named_child(i) { |
| 1298 | self.scan_fn_ref_subtree(c, depth + 1, walked); |
| 1299 | } |
| 1300 | } |
| 1301 | } |
| 1302 | |
| 1303 | fn flush_fn_ref_candidates(&mut self) { |
| 1304 | let cands = std::mem::take(&mut self.fn_ref_cands); |
no test coverage detected