(&self, subdir: &str, stem: &str, extension: &str, content: &str)
| 654 | } |
| 655 | |
| 656 | // Post-order DFS; a revisit of an in-progress module is a cycle. |
| 657 | fn collect_import_closure( |
| 658 | &self, |
| 659 | name: &str, |
| 660 | source: &str, |
| 661 | source_path: Option<PathBuf>, |
| 662 | order: &mut Vec<(String, String, Option<PathBuf>)>, |
| 663 | visited: &mut std::collections::HashSet<String>, |
| 664 | stack: &mut Vec<String>, |
| 665 | stack_keys: &mut Vec<String>, |
| 666 | stack_sources: &mut Vec<String>, |
| 667 | ) -> Result<(), CompilationError> { |
| 668 | if visited.contains(name) { |
| 669 | return Ok(()); |
| 670 | } |
| 671 | let identity = source_identity(name, source_path.as_deref()); |
| 672 | if stack.iter().any(|m| m == name) |
| 673 | || stack_keys.iter().any(|key| key == &identity) |
| 674 | || stack_sources.iter().any(|seen| seen == source) |
| 675 | { |
| 676 | // The qualified module system forbids cycles; the kernel's flat build (mangling off) |
no outgoing calls
no test coverage detected