Skip to content

Make tidy::Version public - #160932

Open
Kat-zorn wants to merge 2 commits into
rust-lang:mainfrom
Kat-zorn:main
Open

Make tidy::Version public#160932
Kat-zorn wants to merge 2 commits into
rust-lang:mainfrom
Kat-zorn:main

Conversation

@Kat-zorn

Copy link
Copy Markdown

The tidy library in src/tools/tidy is used to implement the tidy tool, but is also used by other in-tree crates like feature-status-dump to analyze which features are defined in the project. This PR makes the Version struct public. This has the effect of being able to construct a version using Version::from_str("1.80.0").unwrap(). This can then be used to compare (via the already implemented PartialEq trait) the version where a feature was introduced against a user-provided value, rather than only against other features' versions.

I would like this change because I am working on a tool to filter features for several metrics (stability, first version, activity of tracking issue, etc) to help find abandoned features that need someone to push to stabilize them.

This is my first PR here. I hope it is welcome.

@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 11, 2026
@rustbot

rustbot commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @jieyouxu (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mod version;
use regex::Regex;
use version::Version;
pub use version::Version;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggestion: please add a comment here that e.g. features-status-dump is using this, otherwise it's easy to think this is a dead re-export.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

There is currently no in-tree use of Version (as it is not yet public). features-status-dump just serialises the features to JSON and has no use for this. unstable-book-gen could use it to show when certain compiler flags were introduced, if rustc -Zhelp would print that, but currently doesn't and probably won't.

The main use for exporting Version is for the tool that I'm building, where it would allow users to filter on features introduced before/after a certain version. If you prefer to instead only re-export if there's an in-tree crate using it, I can look into making my tool an extension of features-status-dump instead, and add this change as part of that PR.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2026
@rustbot

rustbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Kat-zorn

Copy link
Copy Markdown
Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants