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

Change the MSRV policy and bump to 1.79.0 #480

Merged
merged 6 commits into from
Jan 22, 2025
Merged

Change the MSRV policy and bump to 1.79.0 #480

merged 6 commits into from
Jan 22, 2025

Conversation

bal-e
Copy link
Contributor

@bal-e bal-e commented Jan 13, 2025

The MSRV is being bumped so that domain can access newer language features. In particular:

  • <[u8]>::utf8_chunks() (1.79) is very useful for processing byte strings that will mostly contain valid UTF-8 text.
  • core::net (1.77) allows us to remove our polyfills of Ipv4Addr etc., used when the std feature is disabled.
  • async fn and return-position impl Trait in traits (1.75) allow us to define traits using async fn, avoiding the overhead of Box<dyn Future> for un-nameable future types.
  • Option::is_some_and() (1.70) simplifies a very common pattern when inspecting optional values.

The MSRV bump policy is also being updated; it sets a maximum MSRV (relative to the latest stable Rust version) and documents the conditions under which a bump will occur.

@bal-e bal-e requested review from partim and a team January 13, 2025 16:58
@bal-e bal-e marked this pull request as ready for review January 13, 2025 18:46
Cargo.toml Outdated
# This is the mimimal Rust version with minimal dependencies as specified
# below. With latest dependency versions 1.76.0 is currently required.
rust-version = "1.68.2"
# We keep our MSRV 4 versions behind stable (about half a year).
Copy link
Member

Choose a reason for hiding this comment

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

I think the 4 versions behind rule is fine if we want to use new features. But if we don't need any features from 1.80.1 then er is no reason to bump it to that version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. For reference, here's a list of notable features since 1.68.2:

  • 1.80: <[u8]>::trim_ascii(), LazyLock, exclusive ranges in patterns
  • 1.79: associated type bounds (T: Trait<Assoc: Bound>), better borrow checking, <[u8]>::utf8_chunks
  • 1.78: custom diagnostic messages
  • 1.77: C string literals, recursive async fns, core::net::{Ipv4Addr,Ipv6Addr}
  • 1.75: async fn and return position impl Trait in traits, pointer byte offsets
  • 1.70: Option::is_some_and()

I don't think 1.80 is strictly necessary, but utf8_chunks from 1.79 would be quite helpful (for formatting labels and domain names, which are usually -- but not always -- ASCII text).

Copy link
Member

Choose a reason for hiding this comment

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

I think we should also have a policy that the MSRV bump comes with the code that needs the new features or if the MSRV is in anticipation, then the commit should describe the reason for the bump.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather keep MSRV bumps separate from the code that's using them, but I absolutely agree that the MSRV bump commit should document why the bump is happening and what features will be used. I'll add a note about it.

@bal-e bal-e changed the title Change the MSRV policy and bump to 1.80.1 Change the MSRV policy and bump to 1.79.0 Jan 20, 2025
@bal-e bal-e requested a review from a team January 20, 2025 17:56
@bal-e
Copy link
Contributor Author

bal-e commented Jan 21, 2025

There has been previous discussion about MSRV bumps at #322. @vavrusa, I just wanted to check that the proposed MSRV policy (i.e. MSRV is at least 4 versions behind stable, or older) is compatible with your use case.

@bal-e bal-e merged commit 54886e0 into main Jan 22, 2025
17 checks passed
@bal-e bal-e deleted the new-msrv branch January 22, 2025 10:22
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.

3 participants