Skip to content

Commit 3893d16

Browse files
committed
Tweak duplicate matcher binding error
1 parent 1eeed17 commit 3893d16

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

src/libsyntax_expand/mbe/macro_check.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ fn check_binders(
269269
// for nested macro definitions.
270270
sess.span_diagnostic
271271
.struct_span_err(span, "duplicate matcher binding")
272-
.span_note(prev_info.span, "previous declaration was here")
272+
.span_label(span, "duplicate binding")
273+
.span_label(prev_info.span, "previous binding")
273274
.emit();
274275
*valid = false;
275276
} else {

src/test/ui/macros/macro-multiple-matcher-bindings.stderr

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,33 @@ error: duplicate matcher binding
22
--> $DIR/macro-multiple-matcher-bindings.rs:7:16
33
|
44
LL | ($a:ident, $a:ident) => {};
5-
| ^^^^^^^^
6-
|
7-
note: previous declaration was here
8-
--> $DIR/macro-multiple-matcher-bindings.rs:7:6
9-
|
10-
LL | ($a:ident, $a:ident) => {};
11-
| ^^^^^^^^
5+
| -------- ^^^^^^^^ duplicate binding
6+
| |
7+
| previous binding
128

139
error: duplicate matcher binding
1410
--> $DIR/macro-multiple-matcher-bindings.rs:8:16
1511
|
1612
LL | ($a:ident, $a:path) => {};
17-
| ^^^^^^^
18-
|
19-
note: previous declaration was here
20-
--> $DIR/macro-multiple-matcher-bindings.rs:8:6
21-
|
22-
LL | ($a:ident, $a:path) => {};
23-
| ^^^^^^^^
13+
| -------- ^^^^^^^ duplicate binding
14+
| |
15+
| previous binding
2416

2517
error: duplicate matcher binding
2618
--> $DIR/macro-multiple-matcher-bindings.rs:17:18
2719
|
2820
LL | ($a:ident, $($a:ident),*) => {};
29-
| ^^^^^^^^
30-
|
31-
note: previous declaration was here
32-
--> $DIR/macro-multiple-matcher-bindings.rs:17:6
33-
|
34-
LL | ($a:ident, $($a:ident),*) => {};
35-
| ^^^^^^^^
21+
| -------- ^^^^^^^^ duplicate binding
22+
| |
23+
| previous binding
3624

3725
error: duplicate matcher binding
3826
--> $DIR/macro-multiple-matcher-bindings.rs:18:25
3927
|
4028
LL | ($($a:ident)+ # $($($a:path),+);*) => {};
41-
| ^^^^^^^
42-
|
43-
note: previous declaration was here
44-
--> $DIR/macro-multiple-matcher-bindings.rs:18:8
45-
|
46-
LL | ($($a:ident)+ # $($($a:path),+);*) => {};
47-
| ^^^^^^^^
29+
| -------- ^^^^^^^ duplicate binding
30+
| |
31+
| previous binding
4832

4933
error: aborting due to 4 previous errors
5034

0 commit comments

Comments
 (0)