-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priorityLow priority
Description
As per #59453 (comment), given the code
| Enum::Foo(a, b) => {} |
we emit
rust/src/test/ui/parser/recover-from-bad-variant.stderr
Lines 1 to 13 in 3592079
| error: expected type, found `3` | |
| --> $DIR/recover-from-bad-variant.rs:7:26 | |
| | | |
| LL | let x = Enum::Foo(a: 3, b: 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 expects an ascribed type after the colon | |
| --> $DIR/recover-from-bad-variant.rs:7:23 | |
| | | |
| LL | let x = Enum::Foo(a: 3, b: 4); | |
| | ^ | |
| = help: this might be indicative of a syntax error elsewhere |
We should mention the feature gate:
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
Centril
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-lowLow priorityLow priority