diff --git a/src/test/compile-fail/macro-expanded-mod.rs b/src/test/compile-fail/directory_ownership/macro-expanded-mod.rs similarity index 100% rename from src/test/compile-fail/macro-expanded-mod.rs rename to src/test/compile-fail/directory_ownership/macro-expanded-mod.rs diff --git a/src/test/compile-fail/macro_expanded_mod_helper/foo/bar.rs b/src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/bar.rs similarity index 100% rename from src/test/compile-fail/macro_expanded_mod_helper/foo/bar.rs rename to src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/bar.rs diff --git a/src/test/compile-fail/macro_expanded_mod_helper/foo/mod.rs b/src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/mod.rs similarity index 100% rename from src/test/compile-fail/macro_expanded_mod_helper/foo/mod.rs rename to src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/mod.rs diff --git a/src/test/compile-fail/mod_file_not_owning.rs b/src/test/compile-fail/directory_ownership/mod_file_not_owning.rs similarity index 94% rename from src/test/compile-fail/mod_file_not_owning.rs rename to src/test/compile-fail/directory_ownership/mod_file_not_owning.rs index 7dcff6e6644f..adbcedd91f20 100644 --- a/src/test/compile-fail/mod_file_not_owning.rs +++ b/src/test/compile-fail/directory_ownership/mod_file_not_owning.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// compile-flags: -Z parse-only - // error-pattern: cannot declare a new module at this location mod mod_file_not_owning_aux1; diff --git a/src/test/compile-fail/mod_file_not_owning_aux1.rs b/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1.rs similarity index 87% rename from src/test/compile-fail/mod_file_not_owning_aux1.rs rename to src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1.rs index 2d522be6dc5d..4ac94a92e376 100644 --- a/src/test/compile-fail/mod_file_not_owning_aux1.rs +++ b/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1.rs @@ -10,4 +10,7 @@ // ignore-test this is not a test -mod mod_file_not_owning_aux2; +macro_rules! m { + () => { mod mod_file_not_owning_aux2; } +} +m!(); diff --git a/src/test/compile-fail/mod_file_not_owning_aux2.rs b/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux2.rs similarity index 100% rename from src/test/compile-fail/mod_file_not_owning_aux2.rs rename to src/test/compile-fail/directory_ownership/mod_file_not_owning_aux2.rs diff --git a/src/test/compile-fail/non-inline-mod-restriction.rs b/src/test/compile-fail/directory_ownership/non-inline-mod-restriction.rs similarity index 100% rename from src/test/compile-fail/non-inline-mod-restriction.rs rename to src/test/compile-fail/directory_ownership/non-inline-mod-restriction.rs diff --git a/src/test/compile-fail/directory_ownership/unowned_mod_with_path.rs b/src/test/compile-fail/directory_ownership/unowned_mod_with_path.rs new file mode 100644 index 000000000000..854f790befcf --- /dev/null +++ b/src/test/compile-fail/directory_ownership/unowned_mod_with_path.rs @@ -0,0 +1,15 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern: cannot declare a new module at this location + +// This is not a directory owner since the file name is not "mod.rs". +#[path = "mod_file_not_owning_aux1.rs"] +mod foo;