-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Conversation
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). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 fn
s,core::net::{Ipv4Addr,Ipv6Addr}
- 1.75:
async fn
and return positionimpl 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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 ofIpv4Addr
etc., used when thestd
feature is disabled.async fn
and return-positionimpl Trait
in traits (1.75) allow us to define traits usingasync fn
, avoiding the overhead ofBox<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.