pub fn format_path(path: &Path) -> StringExpand description
Single source of truth for how paths render in compiler diagnostics.
- Strips the current working directory prefix when present, so a script
path stored as
C:\…\runescape\content\scripts\foo.rs2(canonicalized by the pointer checker) and one stored ascontent/scripts/foo.rs2(the raw walker output) both render ascontent/scripts/foo.rs2. - Normalizes separators to
/so output is identical across platforms and stable in test fixtures and CI logs.
All phases must format paths through this helper.