Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: filter catch_all variant in EnumInfo methods #150

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

duskmoon314
Copy link
Contributor

This commit filters out catch_all variant in the variant_idents and variant_expressions of EnumInfo. This allows the catch_all variant to be in the middle of enum.

A test of catch_all variant in the middle of enum is also added.

Fix #149

This commit filters out catch_all variant in the `variant_idents` and
`variant_expressions` of `EnumInfo`. This allows the catch_all variant
to be in the middle of enum.

A test of catch_all variant in the middle of enum is also added.

Fix illicitonion#149
Copy link
Owner

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much!

@duskmoon314
Copy link
Contributor Author

Warning: note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml

It seems config should be renamed to config.toml. And this caused trybuild to panic.

@duskmoon314
Copy link
Contributor Author

It's weird that I haven't found .config or lines that create .config in CI. I wonder whether this is caused by the archived actions-rs/cargo.

Since actions-rs/cargo is archived, I think it could be replaced by run: cargo test <..args>.

May I ask what's your opinion? @illicitonion

@illicitonion
Copy link
Owner

Thanks for looking at the .config stuff - I think this is a relic created by older versions of trybuild, and that to work around it we'll probably need to bump MSRV. I'll put this together as a separate PR shortly!

@illicitonion illicitonion merged commit b006342 into illicitonion:main Jul 29, 2024
7 checks passed
@duskmoon314 duskmoon314 deleted the catch_all_in_middle branch July 29, 2024 12:08
@illicitonion
Copy link
Owner

Published in 0.7.3 - thanks again so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

catch_all generates compilation errors and incorrect discriminant when it is not the last variant
2 participants