Skip to content

Commit 5371ddf

Browse files
committed
Auto merge of #68080 - varkor:declared-here, r=petrochenkov
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2 parents ecde10f + 4583283 commit 5371ddf

File tree

384 files changed

+439
-439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+439
-439
lines changed

Diff for: src/librustc/lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ pub fn struct_lint_level<'a>(
259259
&mut err,
260260
DiagnosticMessageId::from(lint),
261261
src,
262-
"lint level defined here",
262+
"the lint level is defined here",
263263
);
264264
if lint_attr_name.as_str() != name {
265265
let level_str = level.as_str();

Diff for: src/librustc/middle/lang_items.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,17 +204,17 @@ impl LanguageItemCollector<'tcx> {
204204
},
205205
};
206206
if let Some(span) = self.tcx.hir().span_if_local(original_def_id) {
207-
err.span_note(span, "first defined here");
207+
err.span_note(span, "the lang item is first defined here");
208208
} else {
209209
match self.tcx.extern_crate(original_def_id) {
210210
Some(ExternCrate {dependency_of, ..}) => {
211211
err.note(&format!(
212-
"first defined in crate `{}` (which `{}` depends on)",
212+
"the lang item is first defined in crate `{}` (which `{}` depends on)",
213213
self.tcx.crate_name(original_def_id.krate),
214214
self.tcx.crate_name(*dependency_of)));
215215
},
216216
_ => {
217-
err.note(&format!("first defined in crate `{}`.",
217+
err.note(&format!("the lang item is first defined in crate `{}`.",
218218
self.tcx.crate_name(original_def_id.krate)));
219219
}
220220
}

Diff for: src/librustc_lint/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
894894
diag.note(note);
895895
if let ty::Adt(def, _) = ty.kind {
896896
if let Some(sp) = self.cx.tcx.hir().span_if_local(def.did) {
897-
diag.span_note(sp, "type defined here");
897+
diag.span_note(sp, "the type is defined here");
898898
}
899899
}
900900
diag.emit();

Diff for: src/librustc_metadata/creader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ impl<'a> CrateLoader<'a> {
694694
self.sess
695695
.struct_span_err(*span2, "cannot define multiple global allocators")
696696
.span_label(*span2, "cannot define a new global allocator")
697-
.span_label(*span1, "previous global allocator is defined here")
697+
.span_label(*span1, "previous global allocator defined here")
698698
.emit();
699699
true
700700
}

Diff for: src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12671267

12681268
err.span_label(
12691269
upvar_span,
1270-
format!("`{}` is declared here, outside of the {} body", upvar_name, escapes_from),
1270+
format!("`{}` declared here, outside of the {} body", upvar_name, escapes_from),
12711271
);
12721272

12731273
err.span_label(borrow_span, format!("borrow is only valid in the {} body", escapes_from));

Diff for: src/librustc_mir/borrow_check/diagnostics/region_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
457457
diag.span_label(
458458
outlived_fr_span,
459459
format!(
460-
"`{}` is declared here, outside of the {} body",
460+
"`{}` declared here, outside of the {} body",
461461
outlived_fr_name, escapes_from
462462
),
463463
);

Diff for: src/librustc_mir/transform/check_consts/validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ fn check_short_circuiting_in_const_local(item: &Item<'_, 'tcx>) {
625625
}
626626
for local in locals {
627627
let span = body.local_decls[local].source_info.span;
628-
error.span_note(span, "more locals defined here");
628+
error.span_note(span, "more locals are defined here");
629629
}
630630
error.emit();
631631
}

Diff for: src/librustc_passes/diagnostic_items.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ fn collect_item(
7373
)),
7474
};
7575
if let Some(span) = tcx.hir().span_if_local(original_def_id) {
76-
err.span_note(span, "first defined here");
76+
err.span_note(span, "the diagnostic item is first defined here");
7777
} else {
7878
err.note(&format!(
79-
"first defined in crate `{}`.",
79+
"the diagnostic item is first defined in crate `{}`.",
8080
tcx.crate_name(original_def_id.krate)
8181
));
8282
}

Diff for: src/librustc_typeck/astconv.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2220,7 +2220,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
22202220

22212221
let mut could_refer_to = |kind: DefKind, def_id, also| {
22222222
let note_msg = format!(
2223-
"`{}` could{} refer to {} defined here",
2223+
"`{}` could{} refer to the {} defined here",
22242224
assoc_ident,
22252225
also,
22262226
kind.descr(def_id)

Diff for: src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `[v2]` cannot be resolved, ignoring it.
44
LL | /// [v2]
55
| ^^ cannot be resolved, ignoring
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/deny-intra-link-resolution-failure.rs:1:9
99
|
1010
LL | #![deny(intra_doc_link_resolution_failure)]

Diff for: src/test/rustdoc-ui/deny-missing-docs-crate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | |
66
LL | | pub struct Foo;
77
| |_______________^
88
|
9-
note: lint level defined here
9+
note: the lint level is defined here
1010
--> $DIR/deny-missing-docs-crate.rs:1:9
1111
|
1212
LL | #![deny(missing_docs)]

Diff for: src/test/rustdoc-ui/deny-missing-docs-macro.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: missing documentation for macro
44
LL | macro_rules! foo {
55
| ^^^^^^^^^^^^^^^^
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/deny-missing-docs-macro.rs:3:9
99
|
1010
LL | #![deny(missing_docs)]

Diff for: src/test/rustdoc-ui/doc-without-codeblock.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | pub fn bar() {}
1010
LL | | }
1111
| |_^
1212
|
13-
note: lint level defined here
13+
note: the lint level is defined here
1414
--> $DIR/doc-without-codeblock.rs:1:9
1515
|
1616
LL | #![deny(missing_doc_code_examples)]

Diff for: src/test/rustdoc-ui/intra-doc-alias-ice.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `[TypeAlias::hoge]` cannot be resolved, ignoring it.
44
LL | /// [broken cross-reference](TypeAlias::hoge)
55
| ^^^^^^^^^^^^^^^ cannot be resolved, ignoring
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/intra-doc-alias-ice.rs:1:9
99
|
1010
LL | #![deny(intra_doc_link_resolution_failure)]

Diff for: src/test/rustdoc-ui/intra-link-span-ice-55723.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `[i]` cannot be resolved, ignoring it.
44
LL | /// (arr[i])
55
| ^ cannot be resolved, ignoring
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/intra-link-span-ice-55723.rs:1:9
99
|
1010
LL | #![deny(intra_doc_link_resolution_failure)]

Diff for: src/test/rustdoc-ui/intra-links-ambiguity.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `ambiguous` is both a struct and a function
44
LL | /// [`ambiguous`] is ambiguous.
55
| ^^^^^^^^^^^ ambiguous link
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/intra-links-ambiguity.rs:1:9
99
|
1010
LL | #![deny(intra_doc_link_resolution_failure)]

Diff for: src/test/rustdoc-ui/intra-links-anchors.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `[Foo::f#hola]` has an issue with the link anchor.
44
LL | /// Or maybe [Foo::f#hola].
55
| ^^^^^^^^^^^ struct fields cannot be followed by anchors
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/intra-links-anchors.rs:1:9
99
|
1010
LL | #![deny(intra_doc_link_resolution_failure)]

Diff for: src/test/rustdoc-ui/lint-group.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | | /// println!("sup");
88
LL | | /// ```
99
| |_______^
1010
|
11-
note: lint level defined here
11+
note: the lint level is defined here
1212
--> $DIR/lint-group.rs:7:9
1313
|
1414
LL | #![deny(rustdoc)]
@@ -21,7 +21,7 @@ error: `[error]` cannot be resolved, ignoring it.
2121
LL | /// what up, let's make an [error]
2222
| ^^^^^ cannot be resolved, ignoring
2323
|
24-
note: lint level defined here
24+
note: the lint level is defined here
2525
--> $DIR/lint-group.rs:7:9
2626
|
2727
LL | #![deny(rustdoc)]
@@ -35,7 +35,7 @@ error: missing code example in this documentation
3535
LL | /// wait, this doesn't have a doctest?
3636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3737
|
38-
note: lint level defined here
38+
note: the lint level is defined here
3939
--> $DIR/lint-group.rs:7:9
4040
|
4141
LL | #![deny(rustdoc)]

Diff for: src/test/rustdoc-ui/lint-missing-doc-code-example.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | / mod module1 {
55
LL | | }
66
| |_^
77
|
8-
note: lint level defined here
8+
note: the lint level is defined here
99
--> $DIR/lint-missing-doc-code-example.rs:2:9
1010
|
1111
LL | #![deny(missing_doc_code_examples)]

Diff for: src/test/rustdoc-ui/private-item-doc-test.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | | /// assert!(false);
88
LL | | /// ```
99
| |___________^
1010
|
11-
note: lint level defined here
11+
note: the lint level is defined here
1212
--> $DIR/private-item-doc-test.rs:1:9
1313
|
1414
LL | #![deny(private_doc_tests)]

Diff for: src/test/ui-fulldeps/internal-lints/default_hash_types.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: Prefer FxHashMap over HashMap, it has better performance
44
LL | let _map: HashMap<String, String> = HashMap::default();
55
| ^^^^^^^ help: use: `FxHashMap`
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/default_hash_types.rs:10:8
99
|
1010
LL | #[deny(rustc::default_hash_types)]

Diff for: src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: implementing `LintPass` by hand
44
LL | impl LintPass for Foo {
55
| ^^^^^^^^
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/lint_pass_impl_without_macro.rs:4:9
99
|
1010
LL | #![deny(rustc::lint_pass_impl_without_macro)]

Diff for: src/test/ui-fulldeps/internal-lints/pass_ty_by_ref.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: passing `Ty<'_>` by reference
44
LL | ty_ref: &Ty<'_>,
55
| ^^^^^^^ help: try passing by value: `Ty<'_>`
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/pass_ty_by_ref.rs:4:9
99
|
1010
LL | #![deny(rustc::ty_pass_by_reference)]

Diff for: src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: usage of qualified `ty::Ty<'_>`
44
LL | ty_q: ty::Ty<'_>,
55
| ^^^^^^^^^^ help: try using it unqualified: `Ty<'_>`
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/qualified_ty_ty_ctxt.rs:4:9
99
|
1010
LL | #![deny(rustc::usage_of_qualified_ty)]

Diff for: src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: usage of `ty::TyKind::<kind>`
44
LL | let kind = TyKind::Bool;
55
| ^^^^^^ help: try using ty::<kind> directly: `ty`
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/ty_tykind_usage.rs:9:8
99
|
1010
LL | #[deny(rustc::usage_of_ty_tykind)]

Diff for: src/test/ui-fulldeps/lint-plugin-deny-attr.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ error: item is named 'lintme'
1212
LL | fn lintme() { }
1313
| ^^^^^^^^^^^^^^^
1414
|
15-
note: lint level defined here
15+
note: the lint level is defined here
1616
--> $DIR/lint-plugin-deny-attr.rs:7:9
1717
|
1818
LL | #![deny(test_lint)]

Diff for: src/test/ui-fulldeps/lint-plugin-forbid-attrs.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ error: item is named 'lintme'
3030
LL | fn lintme() { }
3131
| ^^^^^^^^^^^^^^^
3232
|
33-
note: lint level defined here
33+
note: the lint level is defined here
3434
--> $DIR/lint-plugin-forbid-attrs.rs:7:11
3535
|
3636
LL | #![forbid(test_lint)]

Diff for: src/test/ui-fulldeps/lint-tool-test.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ error: item is named 'lintme'
7070
LL | fn lintme() { }
7171
| ^^^^^^^^^^^^^^^
7272
|
73-
note: lint level defined here
73+
note: the lint level is defined here
7474
--> $DIR/lint-tool-test.rs:13:9
7575
|
7676
LL | #![deny(clippy_group)]
@@ -83,7 +83,7 @@ error: item is named 'lintmetoo'
8383
LL | fn lintmetoo() { }
8484
| ^^^^^^^^^^^^^^^^^^
8585
|
86-
note: lint level defined here
86+
note: the lint level is defined here
8787
--> $DIR/lint-tool-test.rs:13:9
8888
|
8989
LL | #![deny(clippy_group)]

Diff for: src/test/ui/allocator/two-allocators.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: cannot define multiple global allocators
22
--> $DIR/two-allocators.rs:6:1
33
|
44
LL | static A: System = System;
5-
| -------------------------- previous global allocator is defined here
5+
| -------------------------- previous global allocator defined here
66
LL | #[global_allocator]
77
LL | static B: System = System;
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator

Diff for: src/test/ui/anon-params-deprecated.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
44
LL | fn foo(i32);
55
| ^^^ help: try naming the parameter or explicitly ignoring it: `_: i32`
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/anon-params-deprecated.rs:1:9
99
|
1010
LL | #![warn(anonymous_parameters)]

Diff for: src/test/ui/associated-const/associated-const-dead-code.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: associated const is never used: `BAR`
44
LL | const BAR: u32 = 1;
55
| ^^^^^^^^^^^^^^^^^^^
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/associated-const-dead-code.rs:1:9
99
|
1010
LL | #![deny(dead_code)]

Diff for: src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `await` is a keyword in the 2018 edition
44
LL | pub mod await {
55
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/2015-edition-error-various-positions.rs:2:9
99
|
1010
LL | #![deny(keyword_idents)]

Diff for: src/test/ui/async-await/await-keyword/2015-edition-warning.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: `await` is a keyword in the 2018 edition
44
LL | pub mod await {
55
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/2015-edition-warning.rs:4:9
99
|
1010
LL | #![deny(keyword_idents)]

Diff for: src/test/ui/async-await/unreachable-lint-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | return; bar().await;
66
| |
77
| any code following this expression is unreachable
88
|
9-
note: lint level defined here
9+
note: the lint level is defined here
1010
--> $DIR/unreachable-lint-1.rs:2:9
1111
|
1212
LL | #![deny(unreachable_code)]

Diff for: src/test/ui/async-await/unused-lifetime.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: lifetime parameter `'a` never used
44
LL | pub async fn func_with_unused_lifetime<'a>(s: &'a str) {
55
| ^^
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/unused-lifetime.rs:7:9
99
|
1010
LL | #![deny(unused_lifetimes)]

Diff for: src/test/ui/attributes/register-attr-tool-unused.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: unused attribute
44
LL | #[register_attr(attr)]
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/register-attr-tool-unused.rs:1:9
99
|
1010
LL | #![deny(unused)]

Diff for: src/test/ui/bad/bad-lint-cap2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: unused import: `std::option`
44
LL | use std::option;
55
| ^^^^^^^^^^^
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/bad-lint-cap2.rs:4:9
99
|
1010
LL | #![deny(warnings)]

Diff for: src/test/ui/bad/bad-lint-cap3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: unused import: `std::option`
44
LL | use std::option;
55
| ^^^^^^^^^^^
66
|
7-
note: lint level defined here
7+
note: the lint level is defined here
88
--> $DIR/bad-lint-cap3.rs:5:9
99
|
1010
LL | #![deny(warnings)]

Diff for: src/test/ui/borrowck/issue-45983.nll.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0521]: borrowed data escapes outside of closure
22
--> $DIR/issue-45983.rs:20:18
33
|
44
LL | let x = None;
5-
| - `x` is declared here, outside of the closure body
5+
| - `x` declared here, outside of the closure body
66
LL | give_any(|y| x = Some(y));
77
| - ^^^^^^^^^^^ `y` escapes the closure body here
88
| |

0 commit comments

Comments
 (0)