]> git.lizzy.rs Git - rust.git/commitdiff
Tweak duplicate matcher binding error
authorEsteban Küber <esteban@kuber.com.ar>
Mon, 25 Nov 2019 20:34:56 +0000 (12:34 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 25 Nov 2019 21:30:52 +0000 (13:30 -0800)
src/libsyntax_expand/mbe/macro_check.rs
src/test/ui/macros/macro-multiple-matcher-bindings.stderr

index 25754ed42177fd5ed18c94d1f8ae3d88059284cb..837e04afd34016a1786e96f3a22f826205477218 100644 (file)
@@ -269,7 +269,8 @@ fn check_binders(
                 // for nested macro definitions.
                 sess.span_diagnostic
                     .struct_span_err(span, "duplicate matcher binding")
-                    .span_note(prev_info.span, "previous declaration was here")
+                    .span_label(span, "duplicate binding")
+                    .span_label(prev_info.span, "previous binding")
                     .emit();
                 *valid = false;
             } else {
index 65362388d7de168a2e3c6ba414278fd068d90cc7..3ad1297ffb2f3961ab497030ad69d70e5b0a3171 100644 (file)
@@ -2,49 +2,33 @@ error: duplicate matcher binding
   --> $DIR/macro-multiple-matcher-bindings.rs:7:16
    |
 LL |     ($a:ident, $a:ident) => {};
-   |                ^^^^^^^^
-   |
-note: previous declaration was here
-  --> $DIR/macro-multiple-matcher-bindings.rs:7:6
-   |
-LL |     ($a:ident, $a:ident) => {};
-   |      ^^^^^^^^
+   |      --------  ^^^^^^^^ duplicate binding
+   |      |
+   |      previous binding
 
 error: duplicate matcher binding
   --> $DIR/macro-multiple-matcher-bindings.rs:8:16
    |
 LL |     ($a:ident, $a:path) => {};
-   |                ^^^^^^^
-   |
-note: previous declaration was here
-  --> $DIR/macro-multiple-matcher-bindings.rs:8:6
-   |
-LL |     ($a:ident, $a:path) => {};
-   |      ^^^^^^^^
+   |      --------  ^^^^^^^ duplicate binding
+   |      |
+   |      previous binding
 
 error: duplicate matcher binding
   --> $DIR/macro-multiple-matcher-bindings.rs:17:18
    |
 LL |     ($a:ident, $($a:ident),*) => {};
-   |                  ^^^^^^^^
-   |
-note: previous declaration was here
-  --> $DIR/macro-multiple-matcher-bindings.rs:17:6
-   |
-LL |     ($a:ident, $($a:ident),*) => {};
-   |      ^^^^^^^^
+   |      --------    ^^^^^^^^ duplicate binding
+   |      |
+   |      previous binding
 
 error: duplicate matcher binding
   --> $DIR/macro-multiple-matcher-bindings.rs:18:25
    |
 LL |     ($($a:ident)+ # $($($a:path),+);*) => {};
-   |                         ^^^^^^^
-   |
-note: previous declaration was here
-  --> $DIR/macro-multiple-matcher-bindings.rs:18:8
-   |
-LL |     ($($a:ident)+ # $($($a:path),+);*) => {};
-   |        ^^^^^^^^
+   |        --------         ^^^^^^^ duplicate binding
+   |        |
+   |        previous binding
 
 error: aborting due to 4 previous errors