about summary refs log tree commit diff
path: root/library/std/src/fs
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-11-19 13:06:35 +0900
committerGitHub <noreply@github.com>2021-11-19 13:06:35 +0900
commitf62984fca98a60cbb545a7c2bce3fc878ce1f1d3 (patch)
tree629331df0280e98f4def1b46f0d54be5c1a047ec /library/std/src/fs
parentb542224fa568b9270c9ad00e398edf842931749e (diff)
parentddc1d58ca83ab2c176929c47bd679cfbe8cf32f9 (diff)
downloadrust-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.rs4
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);
 }