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

Split CrateID CrateNameAndVersionReq #2525

Merged

Conversation

illicitonion
Copy link
Collaborator

Currently we use the same CrateId type for two contexts: A known crate
name + version, and in an annotation to specify a version requirement
that an annotation applies to.

These are different use-cases, and neither should use String to
represent a the version.

Also, update CrateId to use a semver::Version (which is required, not optional).

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

Sounds good to me, just had one request 😄

crate_universe/src/config.rs Show resolved Hide resolved
Currently we use the same CrateId type for two contexts: A known crate
name + version, and in an annotation to specify a version requirement
that an annotation applies to.

These are different use-cases, and neither should use String to
represent a the version.
This will be important because semver::Version doesn't have a default
impl.
@illicitonion illicitonion force-pushed the split-crateid-cratenameandversionreq branch from 7010b83 to 7f1f4fc Compare February 28, 2024 16:28
@illicitonion illicitonion added this pull request to the merge queue Feb 28, 2024
Merged via the queue into bazelbuild:main with commit ebbd6a2 Feb 28, 2024
3 checks passed
@illicitonion illicitonion deleted the split-crateid-cratenameandversionreq branch February 28, 2024 16:41
qtica added a commit to qtica/rules_rust that referenced this pull request Apr 1, 2024
Currently we use the same CrateId type for two contexts: A known crate
name + version, and in an annotation to specify a version requirement
that an annotation applies to.

These are different use-cases, and neither should use String to
represent a the version.

Also, update CrateId to use a `semver::Version` (which is required, not
optional).
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.

None yet

2 participants