Skip to content

Commit

Permalink
Reword message
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Feb 19, 2025
1 parent fe7ed27 commit 7d93f08
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_lint/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,8 @@ lint_opaque_hidden_inferred_bound_sugg = add this bound
lint_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
lint_out_of_scope_macro_calls = cannot find macro `{$path}` in {$scope}
.label = not found in {$scope}
lint_out_of_scope_macro_calls = cannot find macro `{$path}` in the current scope from {$location}
.label = not found from {$location}
.help = import `macro_rules` with `use` to make it callable above its definition
lint_overflowing_bin_hex = literal out of range for `{$ty}`
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_lint/src/early/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ pub(super) fn decorate_lint(
lints::InnerAttributeUnstable::CustomInnerAttribute
}
.decorate_lint(diag),
BuiltinLintDiag::OutOfScopeMacroCalls { span, path, scope } => {
lints::OutOfScopeMacroCalls { span, path, scope }.decorate_lint(diag)
BuiltinLintDiag::OutOfScopeMacroCalls { span, path, location } => {
lints::OutOfScopeMacroCalls { span, path, location }.decorate_lint(diag)
}
BuiltinLintDiag::UnexpectedBuiltinCfg { cfg, cfg_name, controlled_by } => {
lints::UnexpectedBuiltinCfg { cfg, cfg_name, controlled_by }.decorate_lint(diag)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3111,7 +3111,7 @@ pub(crate) struct OutOfScopeMacroCalls {
#[label]
pub span: Span,
pub path: String,
pub scope: String,
pub location: String,
}

#[derive(LintDiagnostic)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint_defs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ pub enum BuiltinLintDiag {
OutOfScopeMacroCalls {
span: Span,
path: String,
scope: String,
location: String,
},
UnexpectedBuiltinCfg {
cfg: String,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_resolve/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
None,
);
if fallback_binding.ok().and_then(|b| b.res().opt_def_id()) != Some(def_id) {
let scope = match parent_scope.module.kind {
let location = match parent_scope.module.kind {
ModuleKind::Def(_, _, name) if name == kw::Empty => {
"the crate root".to_string()
}
Expand All @@ -1086,7 +1086,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
BuiltinLintDiag::OutOfScopeMacroCalls {
span: path.span,
path: pprust::path_to_string(path),
scope,
location,
},
);
}
Expand Down
24 changes: 12 additions & 12 deletions tests/ui/attributes/key-value-expansion-scope.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -126,62 +126,62 @@ LL | #![doc = in_block!()]
|
= help: have you added the `#[macro_use]` on the module/import?

warning: cannot find macro `in_root` in the crate root
warning: cannot find macro `in_root` in the current scope from the crate root
--> $DIR/key-value-expansion-scope.rs:1:10
|
LL | #![doc = in_root!()]
| ^^^^^^^ not found in the crate root
| ^^^^^^^ not found from the crate root
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
= help: import `macro_rules` with `use` to make it callable above its definition
= note: `#[warn(out_of_scope_macro_calls)]` on by default

warning: cannot find macro `in_mod_escape` in the crate root
warning: cannot find macro `in_mod_escape` in the current scope from the crate root
--> $DIR/key-value-expansion-scope.rs:4:10
|
LL | #![doc = in_mod_escape!()]
| ^^^^^^^^^^^^^ not found in the crate root
| ^^^^^^^^^^^^^ not found from the crate root
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
= help: import `macro_rules` with `use` to make it callable above its definition

warning: cannot find macro `in_mod` in module `macros_stay`
warning: cannot find macro `in_mod` in the current scope from module `macros_stay`
--> $DIR/key-value-expansion-scope.rs:21:9
|
LL | #[doc = in_mod!()]
| ^^^^^^ not found in module `macros_stay`
| ^^^^^^ not found from module `macros_stay`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
= help: import `macro_rules` with `use` to make it callable above its definition

warning: cannot find macro `in_mod` in module `macros_stay`
warning: cannot find macro `in_mod` in the current scope from module `macros_stay`
--> $DIR/key-value-expansion-scope.rs:24:14
|
LL | #![doc = in_mod!()]
| ^^^^^^ not found in module `macros_stay`
| ^^^^^^ not found from module `macros_stay`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
= help: import `macro_rules` with `use` to make it callable above its definition

warning: cannot find macro `in_mod_escape` in module `macros_escape`
warning: cannot find macro `in_mod_escape` in the current scope from module `macros_escape`
--> $DIR/key-value-expansion-scope.rs:36:9
|
LL | #[doc = in_mod_escape!()]
| ^^^^^^^^^^^^^ not found in module `macros_escape`
| ^^^^^^^^^^^^^ not found from module `macros_escape`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
= help: import `macro_rules` with `use` to make it callable above its definition

warning: cannot find macro `in_mod_escape` in module `macros_escape`
warning: cannot find macro `in_mod_escape` in the current scope from module `macros_escape`
--> $DIR/key-value-expansion-scope.rs:39:14
|
LL | #![doc = in_mod_escape!()]
| ^^^^^^^^^^^^^ not found in module `macros_escape`
| ^^^^^^^^^^^^^ not found from module `macros_escape`
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124535 <https://github.com/rust-lang/rust/issues/124535>
Expand Down

0 comments on commit 7d93f08

Please sign in to comment.