Skip to main content

format_path

Function format_path 

Source
pub fn format_path(path: &Path) -> String
Expand 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 as content/scripts/foo.rs2 (the raw walker output) both render as content/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.