# Error message when definining enum using struct syntax

**URL:** <https://internals.rust-lang.org/t/error-message-when-definining-enum-using-struct-syntax/17669>\
**Category:** language design\
**Created:** [November 2, 2022, 4:03am UTC](https://internals.rust-lang.org/t/error-message-when-definining-enum-using-struct-syntax/17669 "2022-11-02T04:03:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [November 2, 2022, 5:52pm UTC](https://internals.rust-lang.org/t/error-message-when-definining-enum-using-struct-syntax/17669/3 "2022-11-02T17:52:06Z")

</div>

Definitely file bugs when you hit things like this.

Personally, I think that whenever there's an "expected one of" message without a `help:` message, it's a good bug, as a great place for a quick syntax reminder. Sketch:

```nohighlight
error: expected one of `(`, `,`, `=`, `{`, or `}`, found `:`
 --> src/lib.rs:2:8
  |
2 | vec: Vec<usize>,
  | ^ expected one of `(`, `,`, `=`, `{`, or `}`
  |
  | help: enum variants are either `Variant(Type)` or `Variant { field: Type }`

```

---

_[View the full topic](https://internals.rust-lang.org/t/error-message-when-definining-enum-using-struct-syntax/17669)._
