File tree Expand file tree Collapse file tree 8 files changed +10
-31
lines changed
compile-fail/directory_ownership
run-pass/non_modrs_mods/some_crazy_attr_mod_dir/inner_modrs_mod
some_crazy_attr_mod_dir/inner_modrs_mod Expand file tree Collapse file tree 8 files changed +10
-31
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ pub const CFG_RELEASE_NUM: &str = "1.24.0";
2929// An optional number to put after the label, e.g. '.2' -> '-beta.2'
3030// Be sure to make this starts with a dot to conform to semver pre-release
3131// versions (section 9)
32- pub const CFG_PRERELEASE_VERSION : & str = ".2 " ;
32+ pub const CFG_PRERELEASE_VERSION : & str = ".3 " ;
3333
3434pub struct GitInfo {
3535 inner : Option < Info > ,
Original file line number Diff line number Diff line change @@ -5876,10 +5876,14 @@ impl<'a> Parser<'a> {
58765876 if let Some ( path) = Parser :: submod_path_from_attr ( outer_attrs, & self . directory . path ) {
58775877 return Ok ( ModulePathSuccess {
58785878 directory_ownership : match path. file_name ( ) . and_then ( |s| s. to_str ( ) ) {
5879- Some ( "mod.rs" ) => DirectoryOwnership :: Owned { relative : None } ,
5880- Some ( _) => {
5881- DirectoryOwnership :: Owned { relative : Some ( id) }
5882- }
5879+ // All `#[path]` files are treated as though they are a `mod.rs` file.
5880+ // This means that `mod foo;` declarations inside `#[path]`-included
5881+ // files are siblings,
5882+ //
5883+ // Note that this will produce weirdness when a file named `foo.rs` is
5884+ // `#[path]` included and contains a `mod foo;` declaration.
5885+ // If you encounter this, it's your own darn fault :P
5886+ Some ( _) => DirectoryOwnership :: Owned { relative : None } ,
58835887 _ => DirectoryOwnership :: UnownedViaMod ( true ) ,
58845888 } ,
58855889 path,
Load Diff This file was deleted.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -34,14 +34,5 @@ error: mod statements in non-mod.rs files are unstable (see issue #44660)
3434 = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
3535 = help: on stable builds, rename this file to inner_foors_mod/mod.rs
3636
37- error: mod statements in non-mod.rs files are unstable (see issue #44660)
38- --> $DIR/some_crazy_attr_mod_dir/arbitrary_name.rs:11:9
39- |
40- 11 | pub mod inner_modrs_mod;
41- | ^^^^^^^^^^^^^^^
42- |
43- = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
44- = help: on stable builds, rename this file to attr_mod/mod.rs
45-
46- error: aborting due to 5 previous errors
37+ error: aborting due to 4 previous errors
4738
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments