about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-03-12 19:27:10 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-03-22 19:50:18 -0700
commit8ba1a97e375451f51d0657e2135d4e6e657fd72e (patch)
tree30437bf238625c71e970e9a8944220148fc58b3c /src/test/ui/parser
parent9f91bee03f3eea93285330354dda54706028671c (diff)
downloadrust-8ba1a97e375451f51d0657e2135d4e6e657fd72e.tar.gz
rust-8ba1a97e375451f51d0657e2135d4e6e657fd72e.zip
Expand suggestions for type ascription parse errors
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/struct-literal-in-for.stderr13
-rw-r--r--src/test/ui/parser/struct-literal-in-if.stderr13
-rw-r--r--src/test/ui/parser/struct-literal-in-while.stderr13
-rw-r--r--src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr13
4 files changed, 52 insertions, 0 deletions
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: `<expr>: <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: `<expr>: <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: `<expr>: <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: `<expr>: <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