Skip to content

Commit 3b63bd5

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 b1cb3c0 + 4583283 commit 3b63bd5

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

src/librustc/lint.rs

Lines changed: 1 addition & 1 deletion
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();

src/librustc/middle/lang_items.rs

Lines changed: 3 additions & 3 deletions
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
}

src/librustc_lint/types.rs

Lines changed: 1 addition & 1 deletion
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();

src/librustc_metadata/creader.rs

Lines changed: 1 addition & 1 deletion
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
}

src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
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));

src/librustc_mir/borrow_check/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
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
);

src/librustc_mir/transform/check_consts/validation.rs

Lines changed: 1 addition & 1 deletion
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
}

src/librustc_passes/diagnostic_items.rs

Lines changed: 2 additions & 2 deletions
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
}

src/librustc_typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
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)

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

Lines changed: 1 addition & 1 deletion
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)]

0 commit comments

Comments
 (0)