External Publication
Visit Post

core::path::Path

Rust Internals [Unofficial] May 9, 2026
Source

For the ecosystem i had in mind

core::path::Path<Syntax>  *borrowed path structure*

alloc::path::PathBuf<Syntax>  *owned path buffer*

std::path::Path  *native OS path, OsStr-backed, filesystem-facing*

a large fraction of code using std::path::Path is not asking the OS anything. It is using Path as a typed lexical structure.

A lower-level generic path abstraction, while the filesystem-facing parts remain in std. Maybe there is room below it for a pure lexical path type.

This is some motivation and i believe its tempting to start a small first practical experiment.

For example, a tar archive uses Unix-style paths regardless of the host OS, and a Git/tooling crate may need to reason about Windows path restrictions while running on Linux. Those are path-syntax problems, not filesystem-access problems.

Discussion in the ATmosphere

Loading comments...