Skip to content

Move code-generated enum from union to int type#7045

Merged
jleibs merged 19 commits intomainfrom
jleibs/deunion_enums
Aug 6, 2024
Merged

Move code-generated enum from union to int type#7045
jleibs merged 19 commits intomainfrom
jleibs/deunion_enums

Conversation

@jleibs
Copy link
Copy Markdown
Contributor

@jleibs jleibs commented Aug 2, 2024

What

Probably best reviewed commit-by-commit.

Although we don't use it anywhere yet, this now supports putting numeric labels directly into our fbs definitions.

/// A test of an enumate with specified values.
enum ValuedEnum: byte {
    /// Default value.
    Default = 0 (default),

    /// One.
    One = 1,

    /// Two.
    Two = 2,

    /// Three.
    Three = 3,

    /// The answer to life, the universe, and everything.
    TheAnswer = 42,
}

Because of this, one notable change is that enum values are no longer shifted by 1. They match the fbs spec for the value.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@jleibs jleibs force-pushed the jleibs/deunion_enums branch from 2bad9a9 to 1f22bd7 Compare August 2, 2024 23:50
@jleibs jleibs force-pushed the jleibs/deunion_enums branch from 1f22bd7 to 00b5dfd Compare August 5, 2024 20:49
@jleibs jleibs added codegen/idl exclude from changelog PRs with this won't show up in CHANGELOG.md labels Aug 5, 2024
@jleibs jleibs marked this pull request as ready for review August 5, 2024 21:44
@jleibs jleibs force-pushed the jleibs/deunion_enums branch from ef031fc to 37d2143 Compare August 5, 2024 21:47
@jleibs jleibs force-pushed the jleibs/deunion_enums branch from 37d2143 to 1017dd3 Compare August 5, 2024 21:50
@jleibs jleibs changed the title Switch rust to int-based enum types Move code-generated num from uion to int type Aug 5, 2024
@jleibs jleibs changed the title Move code-generated num from uion to int type Move code-generated enum from uion to int type Aug 5, 2024
@jleibs jleibs changed the title Move code-generated enum from uion to int type Move code-generated enum from union to int type Aug 5, 2024
@emilk emilk self-requested a review August 6, 2024 06:47
@jleibs jleibs merged commit bd4c894 into main Aug 6, 2024
@jleibs jleibs deleted the jleibs/deunion_enums branch August 6, 2024 14:51
@jleibs
Copy link
Copy Markdown
Contributor Author

jleibs commented Aug 6, 2024

Accidentally merged this early. Fixes addressed in followup: #7078

jleibs added a commit that referenced this pull request Aug 6, 2024
### What
Mis-merged before pushing all fixes.

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7078?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/7078?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!
* [x] If have noted any breaking changes to the log API in
`CHANGELOG.md` and the migration guide

- [PR Build Summary](https://build.rerun.io/pr/7078)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codegen/idl exclude from changelog PRs with this won't show up in CHANGELOG.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move code-generated enum from union to int type.

2 participants