chore(cargo): declare MSRV via rust-version = "1.91"#2002
Open
YOMXXX wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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