-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
windows: An empty path returns os error 123 instead of os error 3 with recent nightly #90940
Copy link
Copy link
Closed
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.Category: This is a bug.O-windowsOperating system: WindowsOperating system: WindowsP-mediumMedium priorityMedium priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Milestone
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`Area: `std::io`, `std::fs`, `std::net` and `std::path`C-bugCategory: This is a bug.Category: This is a bug.O-windowsOperating system: WindowsOperating system: WindowsP-mediumMedium priorityMedium priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
I expected to see this happen:
canonicalize()returns os error 3 (ERROR_PATH_NOT_FOUND)Instead, this happened: it returns os error 123 (
ERROR_INVALID_NAME)This is problematic as
std::io::ErrorKinddoesn't becomeNotFoundbutUncategorized, which isn't useful for most users. Other platforms like Linux returnNotFoundso the former behavior should be correct here.Meta
rustc --version --verbose:The issue doesn't happen on
rustc 1.58.0-nightly (e99963c55 2021-10-29), I think the regression was introduced by #89174.