Skip to content

fix(cli): don't panic during completions when rustup is unavailable - #17263

Merged
weihanglo merged 1 commit into
rust-lang:masterfrom
raushan728:issues/17260
Jul 26, 2026
Merged

fix(cli): don't panic during completions when rustup is unavailable#17263
weihanglo merged 1 commit into
rust-lang:masterfrom
raushan728:issues/17260

Conversation

@raushan728

Copy link
Copy Markdown
Contributor

Closes #17260.

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2026
@rustbot

rustbot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @epage, @weihanglo
  • @epage, @weihanglo expanded to epage, weihanglo
  • Random selection from epage, weihanglo

@raushan728 raushan728 changed the title fix: don't panic during completions when rustup is unavailable fix(cli): don't panic during completions when rustup is unavailable Jul 26, 2026
Comment thread tests/testsuite/completions.rs Outdated
Comment on lines +11 to +12
.env("_CLAP_COMPLETE_INDEX", "1")
.env("_CLAP_IFS", "\n")

@weihanglo weihanglo Jul 26, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following the PR commit style!

Some thoughts:

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For myself, I would rather just not add a test right now. The fix here is straightforward enough.

I actually had the same concern about adding this test since it relies on clap completion internals and I couldn't find similar tests in the repository either. i decided to include it anyway so the regression would be documented, expecting review feedback if this wasn't the preferred direction.

will dorp first commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@weihanglo weihanglo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!

View changes since this review

@weihanglo
weihanglo enabled auto-merge July 26, 2026 14:53
@weihanglo
weihanglo added this pull request to the merge queue Jul 26, 2026
Merged via the queue into rust-lang:master with commit a09737c Jul 26, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2026
@raushan728
raushan728 deleted the issues/17260 branch July 27, 2026 05:17
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 29, 2026
Update cargo submodule




## src/tools/cargo


20 commits in 3efb1f477e99b42974b982d939fd100303cdf7db..a09737c688e6b643b3a2e185d076bb4a298d6965
2026-07-17 23:53:19 +0000 to 2026-07-26 15:00:33 +0000
- fix(cli): don't panic during completions when rustup is unavailable (rust-lang/cargo#17263)
- docs(workspace): add recommended structure to members field (rust-lang/cargo#17166)
- Update cargo-fetch.md to remove cargo-prefetch reference (rust-lang/cargo#16568)
- chore: bump to `libgit2-sys@0.18.7+1.9.6` (rust-lang/cargo#17259)
- Enable build-dir layout v2 on nightly by default (rust-lang/cargo#17258)
- fix(path): clarify error message when path dependency has wrong package (rust-lang/cargo#16927)
- fix(toml): warn on hyphenated lint names and duplicates (rust-lang/cargo#17051)
- fix(test): gate trim-paths tests on split debuginfo support (rust-lang/cargo#17256)
- test(git): Explicitly test for git injection attacks (rust-lang/cargo#17253)
- fix(git): Suggest libgit2 if git-cli fails (rust-lang/cargo#17252)
- fix(diag): bound transitive unused dependency traversal (rust-lang/cargo#17251)
- fix(git): Hide git fetch output without progress  (rust-lang/cargo#17243)
- revert(lint): Remove `new_implicit_minimum_version_req` (rust-lang/cargo#16321) (rust-lang/cargo#17249)
- fix: Add haiku's dylib path (rust-lang/cargo#17248)
- Zsh completion: Add `-p` and `--package` flags for `cargo add` (rust-lang/cargo#17247)
- refactor(source): Clarify the name of the remote git registry (rust-lang/cargo#17240)
- fix(timings): only report units the job queue actually ran (rust-lang/cargo#17238)
- Do not include proc-macro deps in rustc search path args (rust-lang/cargo#17236)
- chore(deps): update cargo-semver-checks to v0.49.0 (rust-lang/cargo#17237)
- rustdoc: rename the doc parts metadata params (rust-lang/cargo#17234)

## src/tools/rustc-perf

12 commits in 0508bdcd37152b28c39b6752828683cdd3f128b5..74ecbcdf88411937a6e39baf2779948565dfd388
2026-07-15 10:20:27 +0000 to 2026-07-27 15:02:48 +0000
- feat: support `@argfile` for rustc-fake (rust-lang/rustc-perf#2509)
- Download Clippy when a Clippy profile is requested (rust-lang/rustc-perf#2508)
- Add early check for missing rustdoc/clippy in a toolchain (rust-lang/rustc-perf#2507)
- Add 2026-07-21 triage (rust-lang/rustc-perf#2506)
- use stable extract_if: since 1.87 (rust-lang/rustc-perf#2191)
- Update GitHub Actions (rust-lang/rustc-perf#2460)
- Update dependency @types/msgpack-lite to v0.1.12 (rust-lang/rustc-perf#2439)
- Add 30 day history link to artifact size tab on the compare page (rust-lang/rustc-perf#2505)
- Fix selecting color for the bootstrap chart on the toolchain page (rust-lang/rustc-perf#2504)
- Add artifact size history chart to toolchain page (rust-lang/rustc-perf#2501)
- Parallel frontend compiler support (perf backend only) (rust-lang/rustc-perf#2491)
- Run benchmark smoke test for all profiles on Windows on CI (rust-lang/rustc-perf#2503)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 29, 2026
Update cargo submodule




## src/tools/cargo


20 commits in 3efb1f477e99b42974b982d939fd100303cdf7db..a09737c688e6b643b3a2e185d076bb4a298d6965
2026-07-17 23:53:19 +0000 to 2026-07-26 15:00:33 +0000
- fix(cli): don't panic during completions when rustup is unavailable (rust-lang/cargo#17263)
- docs(workspace): add recommended structure to members field (rust-lang/cargo#17166)
- Update cargo-fetch.md to remove cargo-prefetch reference (rust-lang/cargo#16568)
- chore: bump to `libgit2-sys@0.18.7+1.9.6` (rust-lang/cargo#17259)
- Enable build-dir layout v2 on nightly by default (rust-lang/cargo#17258)
- fix(path): clarify error message when path dependency has wrong package (rust-lang/cargo#16927)
- fix(toml): warn on hyphenated lint names and duplicates (rust-lang/cargo#17051)
- fix(test): gate trim-paths tests on split debuginfo support (rust-lang/cargo#17256)
- test(git): Explicitly test for git injection attacks (rust-lang/cargo#17253)
- fix(git): Suggest libgit2 if git-cli fails (rust-lang/cargo#17252)
- fix(diag): bound transitive unused dependency traversal (rust-lang/cargo#17251)
- fix(git): Hide git fetch output without progress  (rust-lang/cargo#17243)
- revert(lint): Remove `new_implicit_minimum_version_req` (rust-lang/cargo#16321) (rust-lang/cargo#17249)
- fix: Add haiku's dylib path (rust-lang/cargo#17248)
- Zsh completion: Add `-p` and `--package` flags for `cargo add` (rust-lang/cargo#17247)
- refactor(source): Clarify the name of the remote git registry (rust-lang/cargo#17240)
- fix(timings): only report units the job queue actually ran (rust-lang/cargo#17238)
- Do not include proc-macro deps in rustc search path args (rust-lang/cargo#17236)
- chore(deps): update cargo-semver-checks to v0.49.0 (rust-lang/cargo#17237)
- rustdoc: rename the doc parts metadata params (rust-lang/cargo#17234)

## src/tools/rustc-perf

12 commits in 0508bdcd37152b28c39b6752828683cdd3f128b5..74ecbcdf88411937a6e39baf2779948565dfd388
2026-07-15 10:20:27 +0000 to 2026-07-27 15:02:48 +0000
- feat: support `@argfile` for rustc-fake (rust-lang/rustc-perf#2509)
- Download Clippy when a Clippy profile is requested (rust-lang/rustc-perf#2508)
- Add early check for missing rustdoc/clippy in a toolchain (rust-lang/rustc-perf#2507)
- Add 2026-07-21 triage (rust-lang/rustc-perf#2506)
- use stable extract_if: since 1.87 (rust-lang/rustc-perf#2191)
- Update GitHub Actions (rust-lang/rustc-perf#2460)
- Update dependency @types/msgpack-lite to v0.1.12 (rust-lang/rustc-perf#2439)
- Add 30 day history link to artifact size tab on the compare page (rust-lang/rustc-perf#2505)
- Fix selecting color for the bootstrap chart on the toolchain page (rust-lang/rustc-perf#2504)
- Add artifact size history chart to toolchain page (rust-lang/rustc-perf#2501)
- Parallel frontend compiler support (perf backend only) (rust-lang/rustc-perf#2491)
- Run benchmark smoke test for all profiles on Windows on CI (rust-lang/rustc-perf#2503)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 29, 2026
Update cargo submodule




## src/tools/cargo

23 commits in 3efb1f477e99b42974b982d939fd100303cdf7db..7c83d4cc0953b81d823e47d640c64da9b8bd4fac
2026-07-17 23:53:19 +0000 to 2026-07-29 21:34:53 +0000
- fix: Pass rustdoc flags to final CCI merge step (rust-lang/cargo#17269)
- Reworked how we enable the new build-dir layout on nightly (rust-lang/cargo#17272)
- Allow setting `-Zembed-metadata` value from the config (rust-lang/cargo#17266)
- fix(cli): don't panic during completions when rustup is unavailable (rust-lang/cargo#17263)
- docs(workspace): add recommended structure to members field (rust-lang/cargo#17166)
- Update cargo-fetch.md to remove cargo-prefetch reference (rust-lang/cargo#16568)
- chore: bump to `libgit2-sys@0.18.7+1.9.6` (rust-lang/cargo#17259)
- Enable build-dir layout v2 on nightly by default (rust-lang/cargo#17258)
- fix(path): clarify error message when path dependency has wrong package (rust-lang/cargo#16927)
- fix(toml): warn on hyphenated lint names and duplicates (rust-lang/cargo#17051)
- fix(test): gate trim-paths tests on split debuginfo support (rust-lang/cargo#17256)
- test(git): Explicitly test for git injection attacks (rust-lang/cargo#17253)
- fix(git): Suggest libgit2 if git-cli fails (rust-lang/cargo#17252)
- fix(diag): bound transitive unused dependency traversal (rust-lang/cargo#17251)
- fix(git): Hide git fetch output without progress  (rust-lang/cargo#17243)
- revert(lint): Remove `new_implicit_minimum_version_req` (rust-lang/cargo#16321) (rust-lang/cargo#17249)
- fix: Add haiku's dylib path (rust-lang/cargo#17248)
- Zsh completion: Add `-p` and `--package` flags for `cargo add` (rust-lang/cargo#17247)
- refactor(source): Clarify the name of the remote git registry (rust-lang/cargo#17240)
- fix(timings): only report units the job queue actually ran (rust-lang/cargo#17238)
- Do not include proc-macro deps in rustc search path args (rust-lang/cargo#17236)
- chore(deps): update cargo-semver-checks to v0.49.0 (rust-lang/cargo#17237)
- rustdoc: rename the doc parts metadata params (rust-lang/cargo#17234)

## src/tools/rustc-perf

12 commits in 0508bdcd37152b28c39b6752828683cdd3f128b5..74ecbcdf88411937a6e39baf2779948565dfd388
2026-07-15 10:20:27 +0000 to 2026-07-27 15:02:48 +0000
- feat: support `@argfile` for rustc-fake (rust-lang/rustc-perf#2509)
- Download Clippy when a Clippy profile is requested (rust-lang/rustc-perf#2508)
- Add early check for missing rustdoc/clippy in a toolchain (rust-lang/rustc-perf#2507)
- Add 2026-07-21 triage (rust-lang/rustc-perf#2506)
- use stable extract_if: since 1.87 (rust-lang/rustc-perf#2191)
- Update GitHub Actions (rust-lang/rustc-perf#2460)
- Update dependency @types/msgpack-lite to v0.1.12 (rust-lang/rustc-perf#2439)
- Add 30 day history link to artifact size tab on the compare page (rust-lang/rustc-perf#2505)
- Fix selecting color for the bootstrap chart on the toolchain page (rust-lang/rustc-perf#2504)
- Add artifact size history chart to toolchain page (rust-lang/rustc-perf#2501)
- Parallel frontend compiler support (perf backend only) (rust-lang/rustc-perf#2491)
- Run benchmark smoke test for all profiles on Windows on CI (rust-lang/rustc-perf#2503)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 30, 2026
Update cargo submodule




## src/tools/cargo

23 commits in 3efb1f477e99b42974b982d939fd100303cdf7db..7c83d4cc0953b81d823e47d640c64da9b8bd4fac
2026-07-17 23:53:19 +0000 to 2026-07-29 21:34:53 +0000
- fix: Pass rustdoc flags to final CCI merge step (rust-lang/cargo#17269)
- Reworked how we enable the new build-dir layout on nightly (rust-lang/cargo#17272)
- Allow setting `-Zembed-metadata` value from the config (rust-lang/cargo#17266)
- fix(cli): don't panic during completions when rustup is unavailable (rust-lang/cargo#17263)
- docs(workspace): add recommended structure to members field (rust-lang/cargo#17166)
- Update cargo-fetch.md to remove cargo-prefetch reference (rust-lang/cargo#16568)
- chore: bump to `libgit2-sys@0.18.7+1.9.6` (rust-lang/cargo#17259)
- Enable build-dir layout v2 on nightly by default (rust-lang/cargo#17258)
- fix(path): clarify error message when path dependency has wrong package (rust-lang/cargo#16927)
- fix(toml): warn on hyphenated lint names and duplicates (rust-lang/cargo#17051)
- fix(test): gate trim-paths tests on split debuginfo support (rust-lang/cargo#17256)
- test(git): Explicitly test for git injection attacks (rust-lang/cargo#17253)
- fix(git): Suggest libgit2 if git-cli fails (rust-lang/cargo#17252)
- fix(diag): bound transitive unused dependency traversal (rust-lang/cargo#17251)
- fix(git): Hide git fetch output without progress  (rust-lang/cargo#17243)
- revert(lint): Remove `new_implicit_minimum_version_req` (rust-lang/cargo#16321) (rust-lang/cargo#17249)
- fix: Add haiku's dylib path (rust-lang/cargo#17248)
- Zsh completion: Add `-p` and `--package` flags for `cargo add` (rust-lang/cargo#17247)
- refactor(source): Clarify the name of the remote git registry (rust-lang/cargo#17240)
- fix(timings): only report units the job queue actually ran (rust-lang/cargo#17238)
- Do not include proc-macro deps in rustc search path args (rust-lang/cargo#17236)
- chore(deps): update cargo-semver-checks to v0.49.0 (rust-lang/cargo#17237)
- rustdoc: rename the doc parts metadata params (rust-lang/cargo#17234)

## src/tools/rustc-perf

12 commits in 0508bdcd37152b28c39b6752828683cdd3f128b5..74ecbcdf88411937a6e39baf2779948565dfd388
2026-07-15 10:20:27 +0000 to 2026-07-27 15:02:48 +0000
- feat: support `@argfile` for rustc-fake (rust-lang/rustc-perf#2509)
- Download Clippy when a Clippy profile is requested (rust-lang/rustc-perf#2508)
- Add early check for missing rustdoc/clippy in a toolchain (rust-lang/rustc-perf#2507)
- Add 2026-07-21 triage (rust-lang/rustc-perf#2506)
- use stable extract_if: since 1.87 (rust-lang/rustc-perf#2191)
- Update GitHub Actions (rust-lang/rustc-perf#2460)
- Update dependency @types/msgpack-lite to v0.1.12 (rust-lang/rustc-perf#2439)
- Add 30 day history link to artifact size tab on the compare page (rust-lang/rustc-perf#2505)
- Fix selecting color for the bootstrap chart on the toolchain page (rust-lang/rustc-perf#2504)
- Add artifact size history chart to toolchain page (rust-lang/rustc-perf#2501)
- Parallel frontend compiler support (perf backend only) (rust-lang/rustc-perf#2491)
- Run benchmark smoke test for all profiles on Windows on CI (rust-lang/rustc-perf#2503)
@rustbot rustbot added this to the 1.99.0 milestone Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area: Command-line interface, option parsing, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

completions crash when rustup is missing

3 participants