diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-11-19 13:06:35 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-19 13:06:35 +0900 |
| commit | f62984fca98a60cbb545a7c2bce3fc878ce1f1d3 (patch) | |
| tree | 629331df0280e98f4def1b46f0d54be5c1a047ec /library/std/src/fs | |
| parent | b542224fa568b9270c9ad00e398edf842931749e (diff) | |
| parent | ddc1d58ca83ab2c176929c47bd679cfbe8cf32f9 (diff) | |
| download | rust-f62984fca98a60cbb545a7c2bce3fc878ce1f1d3.tar.gz rust-f62984fca98a60cbb545a7c2bce3fc878ce1f1d3.zip | |
Rollup merge of #90942 - JohnTitor:should-os-error-3, r=m-ou-se
windows: Return the "Not Found" error when a path is empty Fixes #90940
Diffstat (limited to 'library/std/src/fs')
| -rw-r--r-- | library/std/src/fs/tests.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 1417d860c47..9a8f1e44f1f 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -1430,4 +1430,8 @@ fn create_dir_long_paths() { // This will fail if the path isn't converted to verbatim. path.push("a"); fs::create_dir(&path).unwrap(); + + // #90940: Ensure an empty path returns the "Not Found" error. + let path = Path::new(""); + assert_eq!(path.canonicalize().unwrap_err().kind(), crate::io::ErrorKind::NotFound); } |
