Skip to content

Bump MSRV of utility crates to 1.71#2989

Merged
taiki-e merged 2 commits intomasterfrom
taiki-e/msrv
Feb 15, 2026
Merged

Bump MSRV of utility crates to 1.71#2989
taiki-e merged 2 commits intomasterfrom
taiki-e/msrv

Conversation

@taiki-e
Copy link
Member

@taiki-e taiki-e commented Feb 15, 2026

  error: package `syn v2.0.115` cannot be built because it requires rustc 1.71 or newer, while the currently active rustc version is 1.68.2

```
  error: package `syn v2.0.115` cannot be built because it requires rustc 1.71 or newer, while the currently active rustc version is 1.68.2
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 15, 2026
```
error: this `map_or` can be simplified
   --> futures-util/src/stream/stream/flatten_unordered.rs:374:9
    |
374 |         self.limit.map_or(false, |limit| self.inner_streams.len() >= limit.get())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_map_or
    = note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
help: use is_some_and instead
    |
374 -         self.limit.map_or(false, |limit| self.inner_streams.len() >= limit.get())
374 +         self.limit.is_some_and(|limit| self.inner_streams.len() >= limit.get())
    |
```
@rustbot rustbot added the A-stream Area: futures::stream label Feb 15, 2026
@taiki-e taiki-e removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 15, 2026
@taiki-e taiki-e merged commit 07d1361 into master Feb 15, 2026
25 checks passed
@taiki-e taiki-e deleted the taiki-e/msrv branch February 15, 2026 11:39
@taiki-e taiki-e mentioned this pull request Feb 15, 2026
@matklad
Copy link
Contributor

matklad commented Feb 16, 2026

As a user of the futures crate, I was negatively affected by this change, and, at a first glance, this change doesn't make sense, given the syn motivation:

  • Crates like futures-channel do not transitively depend on the syn ecosystem, and were perfectly usable with older rustc. Now however, the build is actively broken:
error: package `futures-channel v0.3.32` cannot be built because it requires rustc 1.71 or newer, while the currently active rustc version is 1.68.2
  • Even crates like futures-macros, which do depend transitively on syn, are still usable with older rustc, if the user explicitly pins a combination of older syn and newer futures-macros.

In other words, my understanding is that it is an intentional feature that a library MSRV can be lower (more relaxed), than MSRV of its transitive dependencies. This allows the ultimate consumer to craft a lock file that uses new direct dependencies and older transitive dependencies.

Of course, if the motivation here is not to just do what syn does, but rather to directly take advantage of newer language features directly in futures code, then that's totally fine and I'll adjust my code!

matklad added a commit to tigerbeetle/tigerbeetle that referenced this pull request Feb 16, 2026
@taiki-e
Copy link
Member Author

taiki-e commented Feb 16, 2026

Crates like futures-channel do not transitively depend on the syn ecosystem, and were perfectly usable with older rustc. Now however, the build is actively broken:

I'm happy to accept a PR to make MSRV more granular. As we did in crossbeam, this should be easy by using cargo-hack --rust-version in the MSRV check in CI.

Even crates like futures-macros, which do depend transitively on syn, are still usable with older rustc, if the user explicitly pins a combination of older syn and newer futures-macros.

This is an approach I prefer not to take, as I've mentioned several times in the past (e.g., smol-rs/async-io#93 (comment)).

I was negatively affected by this change

the build is actively broken

if the user explicitly pins a combination of older syn and newer futures-macros

Um, your recommendation is to pin dependencies to older versions in MSRV (per smol-rs/async-io#93 (comment)), right? Despite that, is your project still breaking due to dependency's MSRV bump?

@matklad
Copy link
Contributor

matklad commented Feb 16, 2026

This is an approach I prefer not to take, as I've mentioned several times in the past

Ah, right, apologies! FWIW, it looks like since then Cargo error messages improved sufficiently to ameliorate "user confusion" concerns. The full error message I get is:

error: package `futures-channel v0.3.32` cannot be built because it requires rustc 1.71 or newer, while the currently active rustc version is 1.68.2
Either upgrade to rustc 1.71 or newer, or use
cargo update -p futures-channel@0.3.32 --precise ver
where `ver` is the latest version of `futures-channel` supporting rustc 1.68.2

Even if dependency is transitive, the error remains actionable (from last week's syn fallout):

error: package `unicode-ident v1.0.23` cannot be built because it requires rustc 1.71 or newer, while the currently active rustc version is 1.68.2
Either upgrade to rustc 1.71 or newer, or use
cargo update -p unicode-ident@1.0.23 --precise ver
where `ver` is the latest version of `unicode-ident` supporting rustc 1.68.2

It points both the specific transitive package that is problematic, as well as the --precise flag needed to fix it.

I wonder if today, for CI MSRV testing, one can even avoid generating Cargo.lock.min and instead use newer cargo with MSRV-aware resolver to run generate-lockfile which is then fed to an older Cargo?

Despite that, is your project still breaking due to dependency's MSRV bump?

Right, TigerBeetle's context is very peculiar, because we intentionally don't ship any lock files anywhere, as a forcing function to avoid dependencies. More than happy to work-around this on our end! It just seemed to me on the first glance, wrongly, that this change isn't well motivated (I did overlook the fact that futures-rs CI needs to grow more complicated to keep MSRV at 1.68, given that 1.68 doesn't yet have MSRV-aware resolver).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants