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 no_std support if serde is depended on #19

Merged
merged 1 commit into from
May 9, 2020
Merged

Fix no_std support if serde is depended on #19

merged 1 commit into from
May 9, 2020

Conversation

illicitonion
Copy link
Owner

The proc-macro-crate depends on toml, which in turn depends on serde
with std. Only depend on proc-macro-crate if std is enabled.

This means that no_std consumer of num_enum cannot rename their num_enum
dependency. This seems like a reasonable restriction.

Works around rust-lang/cargo#5730

Fixes #18

The proc-macro-crate depends on toml, which in turn depends on serde
_with_ std. Only depend on proc-macro-crate if std is enabled.

This means that no_std consumer of num_enum cannot rename their num_enum
dependency. This seems like a reasonable restriction.

Works around rust-lang/cargo#5730
@illicitonion
Copy link
Owner Author

This is technically a semver breaking change, as it would break anyone who is no_std and has renamed their num_enum dependency, but I'm not quite sure that niche justifies bumping to 0.5... Would appreciate thoughts!

Copy link
Collaborator

@danielhenrymantilla danielhenrymantilla left a comment

Choose a reason for hiding this comment

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

Good job! 👌


Breaking change?

After thinking about it, I have a preference for this being version 0.5.0, i.e., a breaking change semver-wise. Indeed:

  • although extremely unlikley, it is not impossible that some no_std dependency did rename num_enum, as you mentioned;

  • this change is a "fix" for proc-macro-crate is not no_std #18, for which users suffering from it "only" have to bump / update the dependency version. Future users will use the last version anyways.

In other words, I see this as "it is better to risk saving a guilty [person] than to condemn an innocent one": it is better to risk requiring some people to manually bump the version than to make some "innocent" configuration start failing 😄

@illicitonion illicitonion merged commit 128ad3f into master May 9, 2020
@illicitonion illicitonion deleted the serde branch May 9, 2020 15:35
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.

proc-macro-crate is not no_std
2 participants