Skip to content

Cargo +toolchain commands are not rewritten or filtered #3387

Closed

Description

@wangl-cc

Bug

Cargo commands using rustup's +toolchain syntax are not recognized by the current rewrite path. Support for these commands was previously added in #99, including cargo +nightly test, but the behavior is not present in RTK 0.44.2.

Steps to reproduce

Tested with RTK 0.44.2 on macOS:

$ rtk rewrite "cargo +stable check"
$ echo $?
1

$ rtk hook check "cargo +stable check"
No rewrite for: cargo +stable check

In a crate containing a compilation error, compare:

rtk cargo check
rtk cargo +stable check

Actual behavior

rtk cargo check applies the Cargo filter and produces compact output:

cargo check: 1 errors, 0 warnings (1 crates)

rtk cargo +stable check executes the command but produces unfiltered Cargo output.

Expected behavior

rtk rewrite should recognize Cargo commands with a +toolchain selector, preserve the selector, and route the Cargo subcommand through the same output filter used without a selector.

This affects filtered subcommands such as build, check, clippy, and test.

Activity

  1. added
    bug
    good first issue
    on Aug 4, 2026
  2. pszymkowiak commented on Aug 4, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 92%

    Summary

    Regression: rtk rewrite/hook no longer recognizes cargo's +toolchain selector (e.g. cargo +stable check), so the command isn't routed through the Cargo output filter — restore matching that preserves the selector and reuses the existing filter path.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • src/rewrite/cargo.rs
    • src/hook/rewrite.rs

    Triaged automatically by wshm · This is an automated analysis, not a human review.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:clibuggood first issuepriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions