PathBuf display doesn't normilize separators

I met an interesting problem in Rust for Windows. I create PathBuf with a content as something:

"C:\Users\anil\RustBuilds/apha_3"

When I use pathbuf.display(), I expect that foreign slashes will be normalized in Windows way. However it doesn't happen. Say more, documentation tells only about possible problems in showing some characters and what a substitute will be used, however nothing about slashes. I think the documentation should be corrected, because I shipped a product with such Rust behavior, and now a customer isn't happy. If I knew about the behavior upfront, I would normalize slashes explicitly.

I'd recommend filing an issue at rust's issue tracker

Although, may I know how you created such a PathBuf? Generally, correct usage of PathBuf would not result in slashes on windows in the first place.

There also seem to be some edge cases where slashes and backslashes mean different things in windows paths.

.join("foo/bar") will give you mixed slashes. Ideally you should use .join("foo").join("bar") to get platform-specific behavior.

The standard library treats PathBuf more like a String with extra functions than a logical path. Don't expect anything to be normalized for you.

It's probably fine, my complain is in a bad documenting of the current behavior.

Documenting this behavior will guarantee it, which I'm not sure libs-api wants to do.

You can probably just declare in the documentation that handling of mixed separators is unspecified (we may still want to guarantee splitting on them).

I wouldn't be so strict. The documentation can just say : appearance of separators will depend on specific OS implementation and they can be not consistent in a path display.