From 8ba1a97e375451f51d0657e2135d4e6e657fd72e Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Tue, 12 Mar 2019 19:27:10 -0700 Subject: Expand suggestions for type ascription parse errors --- src/test/ui/parser/struct-literal-in-for.stderr | 13 +++++++++++++ src/test/ui/parser/struct-literal-in-if.stderr | 13 +++++++++++++ src/test/ui/parser/struct-literal-in-while.stderr | 13 +++++++++++++ .../ui/parser/struct-literal-restrictions-in-lamda.stderr | 13 +++++++++++++ 4 files changed, 52 insertions(+) (limited to 'src/test/ui/parser') diff --git a/src/test/ui/parser/struct-literal-in-for.stderr b/src/test/ui/parser/struct-literal-in-for.stderr index b319c64f406..2940f465826 100644 --- a/src/test/ui/parser/struct-literal-in-for.stderr +++ b/src/test/ui/parser/struct-literal-in-for.stderr @@ -3,6 +3,19 @@ error: expected type, found `3` | LL | x: 3 | ^ expecting a type here because of type ascription + | + = note: type ascription is a nightly only feature that lets you annotate expressions with a type: `: ` +note: this expression is annotated with type ascription... + --> $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 `{` --> $DIR/struct-literal-in-for.rs:14:12 diff --git a/src/test/ui/parser/struct-literal-in-if.stderr b/src/test/ui/parser/struct-literal-in-if.stderr index 27672eeda83..e7d22ae0292 100644 --- a/src/test/ui/parser/struct-literal-in-if.stderr +++ b/src/test/ui/parser/struct-literal-in-if.stderr @@ -3,6 +3,19 @@ error: expected type, found `3` | LL | x: 3 | ^ expecting a type here because of type ascription + | + = note: type ascription is a nightly only feature that lets you annotate expressions with a type: `: ` +note: this expression is annotated with type ascription... + --> $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 `{` --> $DIR/struct-literal-in-if.rs:14:12 diff --git a/src/test/ui/parser/struct-literal-in-while.stderr b/src/test/ui/parser/struct-literal-in-while.stderr index 8a130f441a3..038e30956ff 100644 --- a/src/test/ui/parser/struct-literal-in-while.stderr +++ b/src/test/ui/parser/struct-literal-in-while.stderr @@ -3,6 +3,19 @@ error: expected type, found `3` | LL | x: 3 | ^ expecting a type here because of type ascription + | + = note: type ascription is a nightly only feature that lets you annotate expressions with a type: `: ` +note: this expression is annotated with type ascription... + --> $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 `{` --> $DIR/struct-literal-in-while.rs:14:12 diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr index 3505d00b64b..b3a6f6ac734 100644 --- a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr +++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr @@ -3,6 +3,19 @@ error: expected type, found `3` | LL | x: 3 | ^ expecting a type here because of type ascription + | + = note: type ascription is a nightly only feature that lets you annotate expressions with a type: `: ` +note: this expression is annotated with type ascription... + --> $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 `{` --> $DIR/struct-literal-restrictions-in-lamda.rs:14:12 -- cgit 1.4.1-3-g733a5