Rust-GCC / Rust-GCC/gccrs

Remove `EnumItemDiscriminant` class

Open
#3,340 10 comments 0 reactions 1 assignee View on GitHub

@saeitoshi-10 is already working on this.

Since Jan 3, 2025.

AST cleanup good-first-pr
Dominant language
C++
Stars
2.9k
Forks
231
Avg merge
19h 55m
Merged PRs (30d)
67

Description

Per the Rust reference: https://doc.rust-lang.org/reference/items/enumerations.html

Meaning that all possible enum items (identifiers, structs or tuples) can have a discriminant, even in 1.49 - however, the feature was still experimental back then.

Still, we need to remove the EnumItemDiscriminant class and instead add an optional std::unique_ptr<Expr> to the base EnumItem class, for all enum items to use it if required.

Eventually we'll also need to fix the parser to handle this

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.