-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Description
I tried this code:
fn main() {
let path = std::path::Path::new("");
if let Err(err) = path.canonicalize() {
println!("{}", err);
// println!("{:?}", err.kind());
}
}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::ErrorKind doesn't become NotFound but Uncategorized, which isn't useful for most users. Other platforms like Linux return NotFound so the former behavior should be correct here.
Meta
rustc --version --verbose:
rustc 1.58.0-nightly (e249ce6b2 2021-10-30)
binary: rustc
commit-hash: e249ce6b2345587d6e11052779c86adbad626dff
commit-date: 2021-10-30
host: x86_64-pc-windows-msvc
release: 1.58.0-nightly
LLVM version: 13.0.0
The issue doesn't happen on rustc 1.58.0-nightly (e99963c55 2021-10-29), I think the regression was introduced by #89174.
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.