-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Windows paths should not be prefixed with \\?\ when displayed #31789
Comments
Rust is canonicalizing the path in order to get a full path, and the method it uses to do so results in a verbatim path that starts with the prefix |
Even if the path is correct, it seems like a usability hazard. Most people, even most programmers, have never seen this path format and would be unnecessarily distracted by it. Is there an easy, robust way to omit the prefix when it's not needed? AIUI |
You can always remove the prefix. It only needs to be there when calling WinAPI file functions (which is not the case here). |
|
@nagisa For UNC paths only |
Triage: are there reproduction instructions for getting this exact error? I have a feeling that this is still the same today, but it would be nice to verify. |
Just build the compiler enough times and you'll run into it. Just got:
|
|
I tried implementing this in the PR linked above. However, I think there are simply too many edge cases that make this far more complex than I'm comfortable with when just using One potential way forward for the standard library would be to have some kind of display configuration for paths. E.g. it could configure things like how to handle unprintable characters or whether to convert verbatim paths. But I've not really thought about how workable this is. Otherwise there are third party crates that people can use. |
That just turns this already confusing error into an insult:
The text was updated successfully, but these errors were encountered: