Skip to content

Commit bb9be9e

Browse files
committed
Auto merge of #47399 - cramertj:modrs-backport, r=Mark-Simulacrum
Backport #47298 to beta #47298
2 parents a19122c + ef6ac6a commit bb9be9e

File tree

8 files changed

+10
-31
lines changed

8 files changed

+10
-31
lines changed

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff 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

3434
pub struct GitInfo {
3535
inner: Option<Info>,

src/libsyntax/parse/parser.rs

+8-4
Original file line numberDiff line numberDiff 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,

src/test/compile-fail/directory_ownership/backcompat-warnings.rs

-16
This file was deleted.

src/test/ui/non_modrs_mods/non_modrs_mods.stderr

+1-10
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)