Skip to content

Commit 835d434

Browse files
committed
Reword message
1 parent fe7ed27 commit 835d434

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

Diff for: compiler/rustc_lint/messages.ftl

+2-2
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,8 @@ lint_opaque_hidden_inferred_bound_sugg = add this bound
630630
lint_or_patterns_back_compat = the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
631631
.suggestion = use pat_param to preserve semantics
632632
633-
lint_out_of_scope_macro_calls = cannot find macro `{$path}` in {$scope}
634-
.label = not found in {$scope}
633+
lint_out_of_scope_macro_calls = cannot find macro `{$path}` in the current scope when looking from {$location}
634+
.label = not found from {$location}
635635
.help = import `macro_rules` with `use` to make it callable above its definition
636636
637637
lint_overflowing_bin_hex = literal out of range for `{$ty}`

Diff for: compiler/rustc_lint/src/early/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ pub(super) fn decorate_lint(
444444
lints::InnerAttributeUnstable::CustomInnerAttribute
445445
}
446446
.decorate_lint(diag),
447-
BuiltinLintDiag::OutOfScopeMacroCalls { span, path, scope } => {
448-
lints::OutOfScopeMacroCalls { span, path, scope }.decorate_lint(diag)
447+
BuiltinLintDiag::OutOfScopeMacroCalls { span, path, location } => {
448+
lints::OutOfScopeMacroCalls { span, path, location }.decorate_lint(diag)
449449
}
450450
BuiltinLintDiag::UnexpectedBuiltinCfg { cfg, cfg_name, controlled_by } => {
451451
lints::UnexpectedBuiltinCfg { cfg, cfg_name, controlled_by }.decorate_lint(diag)

Diff for: compiler/rustc_lint/src/lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3111,7 +3111,7 @@ pub(crate) struct OutOfScopeMacroCalls {
31113111
#[label]
31123112
pub span: Span,
31133113
pub path: String,
3114-
pub scope: String,
3114+
pub location: String,
31153115
}
31163116

31173117
#[derive(LintDiagnostic)]

Diff for: compiler/rustc_lint_defs/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ pub enum BuiltinLintDiag {
821821
OutOfScopeMacroCalls {
822822
span: Span,
823823
path: String,
824-
scope: String,
824+
location: String,
825825
},
826826
UnexpectedBuiltinCfg {
827827
cfg: String,

Diff for: compiler/rustc_resolve/src/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
10701070
None,
10711071
);
10721072
if fallback_binding.ok().and_then(|b| b.res().opt_def_id()) != Some(def_id) {
1073-
let scope = match parent_scope.module.kind {
1073+
let location = match parent_scope.module.kind {
10741074
ModuleKind::Def(_, _, name) if name == kw::Empty => {
10751075
"the crate root".to_string()
10761076
}
@@ -1086,7 +1086,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
10861086
BuiltinLintDiag::OutOfScopeMacroCalls {
10871087
span: path.span,
10881088
path: pprust::path_to_string(path),
1089-
scope,
1089+
location,
10901090
},
10911091
);
10921092
}

Diff for: tests/ui/attributes/key-value-expansion-scope.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -126,62 +126,62 @@ LL | #![doc = in_block!()]
126126
|
127127
= help: have you added the `#[macro_use]` on the module/import?
128128

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

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

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

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

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

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

0 commit comments

Comments
 (0)