From 3980cdecd073789fb5ff7256e2ca40685a289b01 Mon Sep 17 00:00:00 2001 From: "NODA, Kai" Date: Wed, 3 Dec 2014 06:06:59 +0800 Subject: libstd: explicitly disallow io::fs::File to open a directory. On *BSD systems, we can open(2) a directory and directly read(2) from it due to an old tradition. We should avoid doing so by explicitly calling fstat(2) to check the type of the opened file. Opening a directory as a module file can't always be avoided. Even when there's no "path" attribute trick involved, there can always be a *directory* named "my_module.rs". Fix #12460 Signed-off-by: NODA, Kai --- src/test/compile-fail/issue-5806.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/compile-fail/issue-5806.rs b/src/test/compile-fail/issue-5806.rs index 702f02c721d..597366a1b35 100644 --- a/src/test/compile-fail/issue-5806.rs +++ b/src/test/compile-fail/issue-5806.rs @@ -18,9 +18,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-freebsd FIXME #12460 - #[path = "../compile-fail"] -mod foo; //~ ERROR: illegal operation on a directory +mod foo; //~ ERROR: a directory fn main() {} -- cgit 1.4.1-3-g733a5