about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-02-19 18:52:53 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-02-20 17:55:31 +0000
commit835d434c79559f68e22a6ddf6394b84f4fd353cd (patch)
tree56236b2c11ed8018e4876b25c352833efdef7c0b
parentfe7ed278b7cfc8a152dcee29ca6ba583ff0d876d (diff)
downloadrust-835d434c79559f68e22a6ddf6394b84f4fd353cd.tar.gz
rust-835d434c79559f68e22a6ddf6394b84f4fd353cd.zip
Reword message
-rw-r--r--compiler/rustc_lint/messages.ftl4
-rw-r--r--compiler/rustc_lint/src/early/diagnostics.rs4
-rw-r--r--compiler/rustc_lint/src/lints.rs2
-rw-r--r--compiler/rustc_lint_defs/src/lib.rs2
-rw-r--r--compiler/rustc_resolve/src/macros.rs4
-rw-r--r--tests/ui/attributes/key-value-expansion-scope.stderr24
6 files changed, 20 insertions, 20 deletions
diff --git a/compiler/rustc_lint/messages.ftl b/compiler/rustc_lint/messages.ftl
index 1d8bdb94899..67936763427 100644
--- a/compiler/rustc_lint/messages.ftl
+++ b/compiler/rustc_lint/messages.ftl
@@ -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 when looking 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}`
diff --git a/compiler/rustc_lint/src/early/diagnostics.rs b/compiler/rustc_lint/src/early/diagnostics.rs
index d1345467d10..40ca9e05d95 100644
--- a/compiler/rustc_lint/src/early/diagnostics.rs
+++ b/compiler/rustc_lint/src/early/diagnostics.rs
@@ -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)
diff --git a/compiler/rustc_lint/src/lints.rs b/compiler/rustc_lint/src/lints.rs
index afd3117d6bc..00586309572 100644
--- a/compiler/rustc_lint/src/lints.rs
+++ b/compiler/rustc_lint/src/lints.rs
@@ -3111,7 +3111,7 @@ pub(crate) struct OutOfScopeMacroCalls {
     #[label]
     pub span: Span,
     pub path: String,
-    pub scope: String,
+    pub location: String,
 }
 
 #[derive(LintDiagnostic)]
diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs
index efa6a934b00..66fdba28502 100644
--- a/compiler/rustc_lint_defs/src/lib.rs
+++ b/compiler/rustc_lint_defs/src/lib.rs
@@ -821,7 +821,7 @@ pub enum BuiltinLintDiag {
     OutOfScopeMacroCalls {
         span: Span,
         path: String,
-        scope: String,
+        location: String,
     },
     UnexpectedBuiltinCfg {
         cfg: String,
diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs
index 07d1d377b41..a70def2f6c9 100644
--- a/compiler/rustc_resolve/src/macros.rs
+++ b/compiler/rustc_resolve/src/macros.rs
@@ -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()
                     }
@@ -1086,7 +1086,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
                     BuiltinLintDiag::OutOfScopeMacroCalls {
                         span: path.span,
                         path: pprust::path_to_string(path),
-                        scope,
+                        location,
                     },
                 );
             }
diff --git a/tests/ui/attributes/key-value-expansion-scope.stderr b/tests/ui/attributes/key-value-expansion-scope.stderr
index 172b2c54cc6..91a602e57d9 100644
--- a/tests/ui/attributes/key-value-expansion-scope.stderr
+++ b/tests/ui/attributes/key-value-expansion-scope.stderr
@@ -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 when looking 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 when looking 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 when looking 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 when looking 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 when looking 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 when looking 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>