]> git.lizzy.rs Git - rust.git/commitdiff
add the label back but make it shorter
authorMazdak Farrokhzad <twingoow@gmail.com>
Fri, 27 Mar 2020 20:52:09 +0000 (21:52 +0100)
committerMazdak Farrokhzad <twingoow@gmail.com>
Fri, 27 Mar 2020 20:52:09 +0000 (21:52 +0100)
src/librustc_ast_passes/ast_validation.rs
src/test/ui/parser/issue-32214.stderr
src/test/ui/suggestions/suggest-move-types.stderr

index 592d3bf2e052f5001c984a31647e5dd629f251c1..de7ae10723f4de482e993e1a9ee05aacf58fdb5d 100644 (file)
@@ -660,10 +660,11 @@ fn check_generic_args_before_constraints(&self, data: &AngleBracketedArgs) {
         // ...and then error:
         self.err_handler()
             .struct_span_err(
-                misplaced_args,
+                misplaced_args.clone(),
                 "generic arguments must come before the first constraint",
             )
             .span_label(first.unwrap(), "the first constraint is provided here")
+            .span_labels(misplaced_args, "generic argument")
             .emit();
     }
 }
index d25d3a0963304271789c423509f6a9516acf0216..742f4fdc38bbdd40ccb659c6ea1524b9c77f6624 100644 (file)
@@ -2,7 +2,7 @@ error: generic arguments must come before the first constraint
   --> $DIR/issue-32214.rs:3:34
    |
 LL | pub fn test<W, I: Trait<Item=(), W> >() {}
-   |                         -------  ^
+   |                         -------  ^ generic argument
    |                         |
    |                         the first constraint is provided here
 
index a0a8c3fc3ba58fdef20693e907a48144d293e105..4dd0613757a959bddbf352dea2aaf352abd826f5 100644 (file)
@@ -2,7 +2,7 @@ error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:26:26
    |
 LL | struct A<T, M: One<A=(), T>> {
-   |                    ----  ^
+   |                    ----  ^ generic argument
    |                    |
    |                    the first constraint is provided here
 
@@ -10,56 +10,72 @@ error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:33:43
    |
 LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
-   |                                     ----  ^  ^^
-   |                                     |
+   |                                     ----  ^  ^^ generic argument
+   |                                     |     |
+   |                                     |     generic argument
    |                                     the first constraint is provided here
 
 error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:40:46
    |
 LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
-   |                            ----              ^  ^  ^
-   |                            |
+   |                            ----              ^  ^  ^ generic argument
+   |                            |                 |  |
+   |                            |                 |  generic argument
+   |                            |                 generic argument
    |                            the first constraint is provided here
 
 error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:48:71
    |
 LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U, V, 'a, 'b, 'c>> {
-   |                                                     ----              ^  ^  ^  ^^  ^^  ^^
-   |                                                     |
+   |                                                     ----              ^  ^  ^  ^^  ^^  ^^ generic argument
+   |                                                     |                 |  |  |  |   |
+   |                                                     |                 |  |  |  |   generic argument
+   |                                                     |                 |  |  |  generic argument
+   |                                                     |                 |  |  generic argument
+   |                                                     |                 |  generic argument
+   |                                                     |                 generic argument
    |                                                     the first constraint is provided here
 
 error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:57:49
    |
 LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
-   |                               ----              ^  ^
-   |                               |
+   |                               ----              ^  ^ generic argument
+   |                               |                 |
+   |                               |                 generic argument
    |                               the first constraint is provided here
 
 error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:65:78
    |
 LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=(), U, 'b, V, 'c>> {
-   |                                                            ----              ^  ^^  ^  ^^
-   |                                                            |
+   |                                                            ----              ^  ^^  ^  ^^ generic argument
+   |                                                            |                 |  |   |
+   |                                                            |                 |  |   generic argument
+   |                                                            |                 |  generic argument
+   |                                                            |                 generic argument
    |                                                            the first constraint is provided here
 
 error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:74:43
    |
 LL | struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
-   |                               ----        ^        ^
-   |                               |
+   |                               ----        ^        ^ generic argument
+   |                               |           |
+   |                               |           generic argument
    |                               the first constraint is provided here
 
 error: generic arguments must come before the first constraint
   --> $DIR/suggest-move-types.rs:82:72
    |
 LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, 'b, C=(), V, 'c>> {
-   |                                                            ----        ^  ^^        ^  ^^
-   |                                                            |
+   |                                                            ----        ^  ^^        ^  ^^ generic argument
+   |                                                            |           |  |         |
+   |                                                            |           |  |         generic argument
+   |                                                            |           |  generic argument
+   |                                                            |           generic argument
    |                                                            the first constraint is provided here
 
 error[E0747]: type provided when a lifetime was expected