-
Notifications
You must be signed in to change notification settings - Fork 14k
libstd: impl Show for Path #13944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libstd: impl Show for Path #13944
Conversation
|
I believe that the current situation is working as intended. http://static.rust-lang.org/doc/master/std/path/trait.GenericPath.html#method.display |
|
I'm not really sure. I've been trying to instrument a quirk in rustc, and dumping structures with Is this a common thing? I've not run across a struct with a |
|
Not all paths can be fully represented as a string (e.g. the byte 255 is generally a valid path name on Linux, but it is not a valid byte in UTF-8 at all), so an impl of Show would be a lossy conversion. The documentation of this can definitely be improved. |
|
As @huonw said, not all Paths are valid utf-8 strings. This is precisely why it has a If you feel the documentation could be improved, I would be happy to accept a PR on that front. But I am going to close this one as working as intended. |
|
Would a lint/warning at compile time when you try to My goal with this patch was to make seemingly reasonable inputs have reasonable outputs. EDIT: If that seems sane I'm very happy to implement (which seems like it would have carry on wins for all of rust, but if there isn't one already I guess maybe I should put forth an RFC for the |
|
That seems too ad-hoc. Theoretically, one could implement
Ideally, we'd have some way of providing a custom error message when attempting to use Instead, I think we should just verify that the documentation is sufficient. Glancing at the docs for |
|
Thanks for the thorough explanation. It definitely appears that I was just Doing It Wrong. |
…3944) `rustup show active-toolchain` will no longer install the default toolchain starting from Rustup 1.28.0, and `rustup toolchain install` without extra arguments is not supported in Rustup pre-1.28.0. The Rustup change and proposed solution is described in <https://internals.rust-lang.org/t/seeking-beta-testers-for-rustup-v1-28-0/22060>. changelog: none
No description provided.