rtk-ai/rtk

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

已關閉

#1,402 建立於 2026年4月19日

 (1 則留言) (0 個反應) (0 位負責人)Rust (2,914 個分叉)batch import
area:cieffort-smallenhancementgood first issuepriority:low

倉庫指標

星標
 (48,085 顆星)
PR 合併指標
 (平均合併 11天 1小時) (30 天內合併 45 個 PR)

描述

v0.37.1 uses str::floor_char_boundary() in src/cmds/system/pipe_cmd.rs:135, which was stabilized in Rust 1.91.0.

Without rust-version in Cargo.toml, building with Rust < 1.91 fails with a confusing error:

error[E0658]: use of unstable library feature `round_char_boundary`
 --> src/cmds/system/pipe_cmd.rs:135:21
  |
135 | let end = input.floor_char_boundary(end);
    |                 ^^^^^^^^^^^^^^^^^^^

Adding rust-version = "1.91" to [package] in Cargo.toml would give a clear error message at build time instead:

error: package `rtk v0.37.1` cannot be built because it requires rustc 1.91 or newer

This affects distribution packagers (e.g., Arch Linux AUR) where the system Rust version may lag behind.

貢獻者指南