Rollup merge of #147438 - reddevilmidzy:rename-non-inline-module-in-msg, r=fee1-dead

Rename "non-inline module" to "file module" in proc macro diagnostics

This PR updates diagnostic messages to use "file module" instead of "non-inline module". because the term "non-inline module" can be confusing, especially for non-native English speakers.

follow up PR rust-lang/rust#147395
related of rust-lang/rust#147314, [#general > Rename "non-inline modules" to "external modules"](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/.E2.9C.94.20Rename.20.22non-inline.20modules.22.20to.20.22external.20modules.22/near/543361244)

cc ```@Kivooeo```
This commit is contained in:
Matthias Krüger
2025-10-18 23:54:44 +02:00
committed by GitHub
7 changed files with 32 additions and 32 deletions

View File

@@ -49,6 +49,9 @@ expand_feature_removed =
.note = removed in {$removed_rustc_version}{$pull_note} .note = removed in {$removed_rustc_version}{$pull_note}
.reason = {$reason} .reason = {$reason}
expand_file_modules_in_proc_macro_input_are_unstable =
file modules in proc macro input are unstable
expand_glob_delegation_outside_impls = expand_glob_delegation_outside_impls =
glob delegation is only supported in impls glob delegation is only supported in impls
@@ -158,9 +161,6 @@ expand_mve_unrecognized_expr =
expand_mve_unrecognized_var = expand_mve_unrecognized_var =
variable `{$key}` is not recognized in meta-variable expression variable `{$key}` is not recognized in meta-variable expression
expand_non_inline_modules_in_proc_macro_input_are_unstable =
non-inline modules in proc macro input are unstable
expand_or_patterns_back_compat = the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro expand_or_patterns_back_compat = the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
.suggestion = use pat_param to preserve semantics .suggestion = use pat_param to preserve semantics

View File

@@ -1050,7 +1050,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
self.sess, self.sess,
sym::proc_macro_hygiene, sym::proc_macro_hygiene,
item.span, item.span,
fluent_generated::expand_non_inline_modules_in_proc_macro_input_are_unstable, fluent_generated::expand_file_modules_in_proc_macro_input_are_unstable,
) )
.emit(); .emit();
} }

View File

@@ -17,11 +17,11 @@ type A = X; //~ ERROR cannot find type `X` in this scope
mod n {} mod n {}
#[empty_attr] #[empty_attr]
mod module; //~ ERROR non-inline modules in proc macro input are unstable mod module; //~ ERROR file modules in proc macro input are unstable
#[empty_attr] #[empty_attr]
mod outer { mod outer {
mod inner; //~ ERROR non-inline modules in proc macro input are unstable mod inner; //~ ERROR file modules in proc macro input are unstable
mod inner_inline {} // OK mod inner_inline {} // OK
} }
@@ -30,16 +30,16 @@ mod outer {
struct S { struct S {
field: [u8; { field: [u8; {
#[path = "outer/inner.rs"] #[path = "outer/inner.rs"]
mod inner; //~ ERROR non-inline modules in proc macro input are unstable mod inner; //~ ERROR file modules in proc macro input are unstable
mod inner_inline {} // OK mod inner_inline {} // OK
0 0
}] }],
} }
#[identity_attr] #[identity_attr]
fn f() { fn f() {
#[path = "outer/inner.rs"] #[path = "outer/inner.rs"]
mod inner; //~ ERROR non-inline modules in proc macro input are unstable mod inner; //~ ERROR file modules in proc macro input are unstable
mod inner_inline {} // OK mod inner_inline {} // OK
} }

View File

@@ -6,7 +6,7 @@ LL | #[derive(Copy)]
LL | mod n {} LL | mod n {}
| -------- not a `struct`, `enum` or `union` | -------- not a `struct`, `enum` or `union`
error[E0658]: non-inline modules in proc macro input are unstable error[E0658]: file modules in proc macro input are unstable
--> $DIR/attributes-on-modules-fail.rs:20:1 --> $DIR/attributes-on-modules-fail.rs:20:1
| |
LL | mod module; LL | mod module;
@@ -16,7 +16,7 @@ LL | mod module;
= help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable = help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: non-inline modules in proc macro input are unstable error[E0658]: file modules in proc macro input are unstable
--> $DIR/attributes-on-modules-fail.rs:24:5 --> $DIR/attributes-on-modules-fail.rs:24:5
| |
LL | mod inner; LL | mod inner;
@@ -26,7 +26,7 @@ LL | mod inner;
= help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable = help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: non-inline modules in proc macro input are unstable error[E0658]: file modules in proc macro input are unstable
--> $DIR/attributes-on-modules-fail.rs:33:9 --> $DIR/attributes-on-modules-fail.rs:33:9
| |
LL | mod inner; LL | mod inner;
@@ -36,7 +36,7 @@ LL | mod inner;
= help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable = help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: non-inline modules in proc macro input are unstable error[E0658]: file modules in proc macro input are unstable
--> $DIR/attributes-on-modules-fail.rs:42:5 --> $DIR/attributes-on-modules-fail.rs:42:5
| |
LL | mod inner; LL | mod inner;

View File

@@ -9,7 +9,7 @@ extern crate test_macros;
#[deny(unused_attributes)] #[deny(unused_attributes)]
mod module_with_attrs; mod module_with_attrs;
//~^ ERROR non-inline modules in proc macro input are unstable //~^ ERROR file modules in proc macro input are unstable
//~| ERROR custom inner attributes are unstable //~| ERROR custom inner attributes are unstable
fn main() {} fn main() {}

View File

@@ -18,8 +18,8 @@ LL | #![print_attr]
= help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: non-inline modules in proc macro input are unstable error[E0658]: file modules in proc macro input are unstable
--> $DIR/inner-attr-non-inline-mod.rs:11:1 --> $DIR/inner-attr-file-mod.rs:11:1
| |
LL | mod module_with_attrs; LL | mod module_with_attrs;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL | mod module_with_attrs;
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: custom inner attributes are unstable error[E0658]: custom inner attributes are unstable
--> $DIR/inner-attr-non-inline-mod.rs:11:1 --> $DIR/inner-attr-file-mod.rs:11:1
| |
LL | mod module_with_attrs; LL | mod module_with_attrs;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -4,35 +4,35 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct { Punct {
ch: '#', ch: '#',
spacing: Alone, spacing: Alone,
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Group { Group {
delimiter: Bracket, delimiter: Bracket,
stream: TokenStream [ stream: TokenStream [
Ident { Ident {
ident: "deny", ident: "deny",
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Group { Group {
delimiter: Parenthesis, delimiter: Parenthesis,
stream: TokenStream [ stream: TokenStream [
Ident { Ident {
ident: "unused_attributes", ident: "unused_attributes",
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
], ],
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
], ],
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Ident { Ident {
ident: "mod", ident: "mod",
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Ident { Ident {
ident: "module_with_attrs", ident: "module_with_attrs",
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Group { Group {
delimiter: Brace, delimiter: Brace,
@@ -40,38 +40,38 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct { Punct {
ch: '#', ch: '#',
spacing: Joint, spacing: Joint,
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Punct { Punct {
ch: '!', ch: '!',
spacing: Alone, spacing: Alone,
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Group { Group {
delimiter: Bracket, delimiter: Bracket,
stream: TokenStream [ stream: TokenStream [
Ident { Ident {
ident: "rustfmt", ident: "rustfmt",
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Punct { Punct {
ch: ':', ch: ':',
spacing: Joint, spacing: Joint,
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Punct { Punct {
ch: ':', ch: ':',
spacing: Alone, spacing: Alone,
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
Ident { Ident {
ident: "skip", ident: "skip",
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
], ],
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
], ],
span: $DIR/inner-attr-non-inline-mod.rs:11:1: 11:23 (#0), span: $DIR/inner-attr-file-mod.rs:11:1: 11:23 (#0),
}, },
] ]