Skip to content

Set Explicit Discriminants for Errors and Warnings #663

@InsertCreativityHere

Description

@InsertCreativityHere

Doing this would present 2 advantages:

  1. In the implementation of these diagnostics, we always pass a stringified error code:
    Instead of hard-coding these in, we could compute them using the discriminant.
  2. Compile-time guarantee there aren't any duplicate error codes.
    Right now, it's up to us to make sure we don't pass the same error code for two different enums.
    But if we used discriminants, the Rust compiler ensures there's no duplicate values for us.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalslicecRelated to the 'slicec' crate

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions