]> git.lizzy.rs Git - rust.git/commitdiff
Reword type ascription note to reduce verbosity
authorEsteban Küber <esteban@kuber.com.ar>
Sat, 23 Mar 2019 03:14:20 +0000 (20:14 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Sat, 23 Mar 2019 03:14:20 +0000 (20:14 -0700)
src/libsyntax/parse/parser.rs
src/test/ui/error-codes/E0423.stderr
src/test/ui/issues/issue-22644.stderr
src/test/ui/issues/issue-34255-1.stderr
src/test/ui/lifetime_starts_expressions.stderr
src/test/ui/parser/struct-literal-in-for.stderr
src/test/ui/parser/struct-literal-in-if.stderr
src/test/ui/parser/struct-literal-in-while.stderr
src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr
src/test/ui/type/type-ascription-instead-of-statement-end.stderr

index d5b64eaaef549d134ce6617aa5fe6fd8856b0c04..ea81094a996fb04a2096b9fae0c224827a6a4748 100644 (file)
@@ -3708,11 +3708,7 @@ fn bad_type_ascription(
                           you annotate an expression with a type: `<expr>: <type>`");
                 err.span_note(
                     lhs_span,
-                    "this expression is annotated with type ascription...",
-                );
-                err.span_note(
-                    cur_op_span,
-                    "...due to this, which is why a type is expected after",
+                    "this expression expects an ascribed type after the colon",
                 );
                 err.help("this might be indicative of a syntax error elsewhere");
             }
index 29a264ba1628db70ba641745ac6df5f1e888d7a2..b0ef4e1b25413c315c8de5df707a3ded89ec11ec 100644 (file)
@@ -5,16 +5,11 @@ LL |     if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
    |                                       ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/E0423.rs:12:36
    |
 LL |     if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
    |                                    ^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/E0423.rs:12:37
-   |
-LL |     if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
-   |                                     ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: expected expression, found `==`
@@ -30,16 +25,11 @@ LL |     for _ in std::ops::Range { start: 0, end: 10 } {}
    |                                       ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/E0423.rs:21:32
    |
 LL |     for _ in std::ops::Range { start: 0, end: 10 } {}
    |                                ^^^^^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/E0423.rs:21:37
-   |
-LL |     for _ in std::ops::Range { start: 0, end: 10 } {}
-   |                                     ^
    = help: this might be indicative of a syntax error elsewhere
 
 error[E0423]: expected function, found struct `Foo`
index 5d40909f097435c68d691ff48f0c2158026944cd..a28ea0d09f8f0fca7452fabb99118a15dc7155b0 100644 (file)
@@ -90,16 +90,11 @@ LL |     println!("{}", a: &mut 4);
    |                            ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/issue-22644.rs:34:20
    |
 LL |     println!("{}", a: &mut 4);
    |                    ^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/issue-22644.rs:34:21
-   |
-LL |     println!("{}", a: &mut 4);
-   |                     ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: aborting due to 9 previous errors
index 157797054260819a6d9a41aa17bbbefdd9b1e655..7899c8d30f1ddca60eea74c71ded0ba3b83918c1 100644 (file)
@@ -5,16 +5,11 @@ LL |     Test::Drill(field: 42);
    |                        ^^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/issue-34255-1.rs:8:17
    |
 LL |     Test::Drill(field: 42);
    |                 ^^^^^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/issue-34255-1.rs:8:22
-   |
-LL |     Test::Drill(field: 42);
-   |                      ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: aborting due to previous error
index 850e3563cab285205a5ef44fba9c3e1ceb5701c0..cb5a52a3e081a75668a83902803fca0418b88ddb 100644 (file)
@@ -15,16 +15,11 @@ LL |     loop { break 'label: loop { break 'label 42; }; }
    |                          ^^^^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/lifetime_starts_expressions.rs:6:12
    |
 LL |     loop { break 'label: loop { break 'label 42; }; }
    |            ^^^^^^^^^^^^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/lifetime_starts_expressions.rs:6:24
-   |
-LL |     loop { break 'label: loop { break 'label 42; }; }
-   |                        ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: aborting due to 2 previous errors
index 9056fac4226916ba00192106be9d1a4fb6a34fa4..07f2e41ac4fb036e5ffc546feac71947a2ca4191 100644 (file)
@@ -5,16 +5,11 @@ LL |         x: 3
    |            ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/struct-literal-in-for.rs:13:9
    |
 LL |         x: 3
    |         ^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/struct-literal-in-for.rs:13:10
-   |
-LL |         x: 3
-   |          ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
index 558f5a15cc5b5106345252d1f11c474eb0734985..3dd61e74f12eda67e9808948cc727bda1b915b25 100644 (file)
@@ -5,16 +5,11 @@ LL |         x: 3
    |            ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/struct-literal-in-if.rs:13:9
    |
 LL |         x: 3
    |         ^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/struct-literal-in-if.rs:13:10
-   |
-LL |         x: 3
-   |          ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
index ae6e1d4577c3b392a5c81ad6f2fb9dd4c0503d09..d48244654cd023dd43250ecc39e446d45132d8da 100644 (file)
@@ -5,16 +5,11 @@ LL |         x: 3
    |            ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/struct-literal-in-while.rs:13:9
    |
 LL |         x: 3
    |         ^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/struct-literal-in-while.rs:13:10
-   |
-LL |         x: 3
-   |          ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
index 6dbf7eb1b10f78bced9e731fb64c2ee6b0fb58ab..a8c93233dbc535408b4e55e670dcc5aa52cdb19d 100644 (file)
@@ -5,16 +5,11 @@ LL |         x: 3
    |            ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/struct-literal-restrictions-in-lamda.rs:13:9
    |
 LL |         x: 3
    |         ^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/struct-literal-restrictions-in-lamda.rs:13:10
-   |
-LL |         x: 3
-   |          ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
index c80056e44879584b3605709ddfdf7654b31e3f60..2084cbcce4f6253ddd17027f2864c8b7498c288c 100644 (file)
@@ -13,16 +13,11 @@ LL |     println!("test"): 0;
    |                       ^ expecting a type here because of type ascription
    |
    = note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
   --> $DIR/type-ascription-instead-of-statement-end.rs:9:5
    |
 LL |     println!("test"): 0;
    |     ^^^^^^^^^^^^^^^^
-note: ...due to this, which is why a type is expected after
-  --> $DIR/type-ascription-instead-of-statement-end.rs:9:21
-   |
-LL |     println!("test"): 0;
-   |                     ^
    = help: this might be indicative of a syntax error elsewhere
 
 error: aborting due to 2 previous errors