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
//! Filesystem traversal for the source scanner: list every `.rs` file under a crate's
//! `src/`, recursively. Symlink-cycle-safe and error-loud — a subtree it cannot read is a
//! scan error, never a silent skip. Pure `std::fs`: no path-vocabulary or parse logic.
use ;
/// All `.rs` files under `dir`, recursively. A directory that cannot be read (or an
/// entry that cannot be resolved) is a scan error, never a silent skip: a skipped
/// subtree could hide a real module-boundary violation — "cannot judge", not "nothing
/// to judge", the same rule as an unreadable governed file.
///
/// Recurses only into real directories via `entry.file_type().is_dir()` (avoiding symlink
/// recursion cycles), but collects symlinked `.rs` source files. Results are sorted for determinism.
pub