about summary refs log tree commit diff
path: root/src/test/ui/modules
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2021-02-22 16:12:11 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2021-03-05 01:33:43 +0300
commitbc18eb471772403de20cd9bc0a836ce1f5e09e98 (patch)
tree9a09fa564a81a76fbc7831c3eeabc49e0d6d63a4 /src/test/ui/modules
parent45b3c28518e4c45dfd12bc2c4400c0d0e9639927 (diff)
downloadrust-bc18eb471772403de20cd9bc0a836ce1f5e09e98.tar.gz
rust-bc18eb471772403de20cd9bc0a836ce1f5e09e98.zip
expand: Remove obsolete `DirectoryOwnership::UnownedViaMod`
This ownership kind is only constructed in the case of path attributes like `#[path = ".."]` without a file name segment, which always represent some kind of directories and will produce and error on attempt to parse them as a module file.
Diffstat (limited to 'src/test/ui/modules')
-rw-r--r--src/test/ui/modules/path-no-file-name.rs7
-rw-r--r--src/test/ui/modules/path-no-file-name.stderr8
2 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/modules/path-no-file-name.rs b/src/test/ui/modules/path-no-file-name.rs
new file mode 100644
index 00000000000..f62cd2a9eb4
--- /dev/null
+++ b/src/test/ui/modules/path-no-file-name.rs
@@ -0,0 +1,7 @@
+// normalize-stderr-test: "\.:.*\(" -> ".: $$ACCESS_DENIED_MSG ("
+// normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"
+
+#[path = "."]
+mod m; //~ ERROR couldn't read
+
+fn main() {}
diff --git a/src/test/ui/modules/path-no-file-name.stderr b/src/test/ui/modules/path-no-file-name.stderr
new file mode 100644
index 00000000000..32a213c68f6
--- /dev/null
+++ b/src/test/ui/modules/path-no-file-name.stderr
@@ -0,0 +1,8 @@
+error: couldn't read $DIR/.: $ACCESS_DENIED_MSG (os error $ACCESS_DENIED_CODE)
+  --> $DIR/path-no-file-name.rs:5:1
+   |
+LL | mod m;
+   | ^^^^^^
+
+error: aborting due to previous error
+