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

Regression: Generating private enum with EnumDiscriminants is no longer possible when the parent enum is public #390

Open
yescallop opened this issue Nov 18, 2024 · 0 comments

Comments

@yescallop
Copy link

The following user code is broken by #377:

#[derive(EnumDiscriminants)]
#[strum_discriminants(name(PrivateDiscriminants), vis(pub(self)))]
pub enum PublicEnum {
    Variant0(bool),
    Variant1 { a: bool },
}

With an error message:

error[E0446]: private type `PrivateDiscriminants` in public interface

This is because the IntoDiscriminant impl of PublicEnum leaks the private PrivateDiscriminants type. Should we maybe exclude the IntoDiscriminant impl when the parent enum is public and the generated enum is private?

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

No branches or pull requests

1 participant