Skip to content

Commit f4f96e2

Browse files
committed
Normalise diagnostics with respect to "the X is declared/defined here"
1 parent dee12bb commit f4f96e2

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

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
@@ -1259,7 +1259,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
12591259

12601260
err.span_label(
12611261
upvar_span,
1262-
format!("`{}` is declared here, outside of the {} body", upvar_name, escapes_from),
1262+
format!("`{}` declared here, outside of the {} body", upvar_name, escapes_from),
12631263
);
12641264

12651265
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/test/ui/allocator/two-allocators.stderr

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

src/test/ui/borrowck/issue-45983.nll.stderr

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

src/test/ui/generator/ref-escapes-but-not-over-yield.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0521]: borrowed data escapes outside of generator
22
--> $DIR/ref-escapes-but-not-over-yield.rs:11:9
33
|
44
LL | let mut a = &3;
5-
| ----- `a` is declared here, outside of the generator body
5+
| ----- `a` declared here, outside of the generator body
66
...
77
LL | a = &b;
88
| ^^^^--

src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ error[E0521]: borrowed data escapes outside of closure
1919
LL | foo(cell, |cell_a, cell_x| {
2020
| ------ ------ `cell_x` is a reference that is only valid in the closure body
2121
| |
22-
| `cell_a` is declared here, outside of the closure body
22+
| `cell_a` declared here, outside of the closure body
2323
LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
2424
| ^^^^^^^^^^^^^^^^^^^^^^^^ `cell_x` escapes the closure body here
2525

src/test/ui/nll/outlives-suggestion-simple.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ error[E0521]: borrowed data escapes outside of function
9999
LL | fn get_bar(&self) -> Bar2 {
100100
| -----
101101
| |
102-
| `self` is declared here, outside of the function body
102+
| `self` declared here, outside of the function body
103103
| `self` is a reference that is only valid in the function body
104104
LL | Bar2::new(&self)
105105
| ^^^^^^^^^^^^^^^^ `self` escapes the function body here

0 commit comments

Comments
 (0)