Skip to content

chore(cargo): declare MSRV via rust-version = "1.91"#2002

Open
YOMXXX wants to merge 1 commit into
rtk-ai:developfrom
YOMXXX:feat/msrv-1.91
Open

chore(cargo): declare MSRV via rust-version = "1.91"#2002
YOMXXX wants to merge 1 commit into
rtk-ai:developfrom
YOMXXX:feat/msrv-1.91

Conversation

@YOMXXX
Copy link
Copy Markdown
Contributor

@YOMXXX YOMXXX commented May 21, 2026

Summary

`rtk` already uses `str::floor_char_boundary()` (`src/cmds/system/pipe_cmd.rs:140`), stabilized in Rust 1.91.0, but `Cargo.toml` doesn't declare the MSRV. Distribution packagers on older toolchains see a confusing `use of unstable library feature` rustc error instead of a clear cargo-level MSRV diagnostic.

Reproduction

```bash

Without this PR, on Rust 1.88.0:

$ cargo check
error[E0658]: use of unstable library feature `round_char_boundary`
--> src/cmds/system/pipe_cmd.rs:140:21
```

Fix

Add `rust-version = "1.91"` to the `[package]` table.

```toml
[package]
name = "rtk"
version = "0.34.3"
edition = "2021"
rust-version = "1.91" # ← added
```

After

```bash
$ cargo +1.88 check
error: rustc 1.88.0 is not supported by the following packages:
rtk@0.34.3 requires rustc 1.91
```

Cargo gives the right diagnostic at the `[package]`-validation step, before `rustc` ever runs.

Test plan

  • `cargo +1.93 fmt --all -- --check` clean.
  • `cargo +1.93 clippy --all-targets` zero warnings.
  • `cargo +1.93 test --bin rtk -- --test-threads=8` → 1909 passed.
  • `cargo +1.88 check` reproduces the friendly MSRV error (intended behaviour).

Notes

@DavidReque expressed interest a month ago but no PR materialized — happy to defer if they'd prefer to push their own; otherwise this lands the minimal one-line change so packagers stop hitting the unhelpful rustc message.

Fixes #1402

rtk uses `str::floor_char_boundary()` (src/cmds/system/pipe_cmd.rs:140)
which was stabilized in Rust 1.91.0. Without `rust-version` in
Cargo.toml, packagers on older toolchains hit a confusing
`use of unstable library feature` error from rustc.

With this declaration, cargo gives the expected friendly diagnostic
up-front:

    error: rustc 1.88.0 is not supported by the following packages:
      rtk@0.34.3 requires rustc 1.91

Verified locally by switching toolchains:
- cargo +1.88 check → fails with the new clear MSRV error (intended)
- cargo +1.93 fmt/clippy/test → 1909 passed, zero warnings

Fixes rtk-ai#1402
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.

Add rust-version to Cargo.toml (MSRV = 1.91)

1 participant