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

cfg attributes not mirrored to builder struct #222

Closed
TedDriggs opened this issue Nov 24, 2021 · 0 comments · Fixed by #240
Closed

cfg attributes not mirrored to builder struct #222

TedDriggs opened this issue Nov 24, 2021 · 0 comments · Fixed by #240
Labels

Comments

@TedDriggs
Copy link
Collaborator

Consider the following code:

#[derive(Builder)]
#[cfg(feature = "example")]
struct Thing {}

Right now, code inspection suggests this would emit a builder that included a build method for a non-existent type; it should instead be passing the cfg attribute through to skip emitting that builder.

@TedDriggs TedDriggs added the bug label Nov 24, 2021
TedDriggs added a commit that referenced this issue Mar 16, 2022
If a struct is conditionally present, its builder should only be present in the same conditions.

If a struct disables lints, its builder should disable the same lints.

Fixes #222
TedDriggs added a commit that referenced this issue Mar 16, 2022
If a struct is conditionally present, its builder should only be present in the same conditions.

If a struct disables lints, its builder should disable the same lints.

Fixes #222
TedDriggs added a commit that referenced this issue Mar 16, 2022
If a struct is conditionally present, its builder should only be present in the same conditions.

If a struct disables lints, its builder should disable the same lints.

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

Successfully merging a pull request may close this issue.

1 participant