-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(rm): Suggest table flags when none are specified #16533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
For `get_table_mut`, the only error is "not a table" error and this shifts knowledge to where we know that the lookup should always be a table and validation would have already happened for that.
Collaborator
|
r? @weihanglo rustbot has assigned @weihanglo. Use |
weihanglo
approved these changes
Jan 20, 2026
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look nice. Feel free to merge it after fixing the formatting issue.
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jan 23, 2026
Update cargo submodule 14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f 2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000 - chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548) - Increase cache_lock test timeout (rust-lang/cargo#16545) - iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506) - chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543) - test(build-std): adjust snapshot (rust-lang/cargo#16539) - chore: bump to 0.96.0 (rust-lang/cargo#16538) - fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221) - fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535) - fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536) - feat(lints): Add non_kebab_case_bin lint (rust-lang/cargo#16524) - fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533) - fix(patch): clean up patch-related error messages (rust-lang/cargo#16498) - Store artifact deps in build unit dir (rust-lang/cargo#16519) - refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jan 23, 2026
Update cargo submodule 14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f 2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000 - chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548) - Increase cache_lock test timeout (rust-lang/cargo#16545) - iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506) - chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543) - test(build-std): adjust snapshot (rust-lang/cargo#16539) - chore: bump to 0.96.0 (rust-lang/cargo#16538) - fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221) - fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535) - fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536) - feat(lints): Add non_kebab_case_bin lint (rust-lang/cargo#16524) - fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533) - fix(patch): clean up patch-related error messages (rust-lang/cargo#16498) - Store artifact deps in build unit dir (rust-lang/cargo#16519) - refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
rust-bors bot
pushed a commit
to rust-lang/rust
that referenced
this pull request
Jan 24, 2026
Update cargo submodule 14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f 2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000 - chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548) - Increase cache_lock test timeout (rust-lang/cargo#16545) - iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506) - chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543) - test(build-std): adjust snapshot (rust-lang/cargo#16539) - chore: bump to 0.96.0 (rust-lang/cargo#16538) - fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221) - fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535) - fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536) - feat(lints): Add non_kebab_case_bin lint (rust-lang/cargo#16524) - fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533) - fix(patch): clean up patch-related error messages (rust-lang/cargo#16498) - Store artifact deps in build unit dir (rust-lang/cargo#16519) - refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jan 25, 2026
Update cargo submodule 14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f 2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000 - chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548) - Increase cache_lock test timeout (rust-lang/cargo#16545) - iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506) - chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543) - test(build-std): adjust snapshot (rust-lang/cargo#16539) - chore: bump to 0.96.0 (rust-lang/cargo#16538) - fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221) - fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535) - fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536) - feat(lints): Add non_kebab_case_bin lint (rust-lang/cargo#16524) - fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533) - fix(patch): clean up patch-related error messages (rust-lang/cargo#16498) - Store artifact deps in build unit dir (rust-lang/cargo#16519) - refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Jan 26, 2026
Update cargo submodule 14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f 2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000 - chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548) - Increase cache_lock test timeout (rust-lang/cargo#16545) - iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506) - chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543) - test(build-std): adjust snapshot (rust-lang/cargo#16539) - chore: bump to 0.96.0 (rust-lang/cargo#16538) - fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221) - fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535) - fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536) - feat(lints): Add non_kebab_case_bin lint (rust-lang/cargo#16524) - fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533) - fix(patch): clean up patch-related error messages (rust-lang/cargo#16498) - Store artifact deps in build unit dir (rust-lang/cargo#16519) - refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
lnicola
pushed a commit
to lnicola/rust-analyzer
that referenced
this pull request
Jan 27, 2026
Update cargo submodule 14 commits in 85eff7c80277b57f78b11e28d14154ab12fcf643..efcd9f58636c1990393d495159045d9c35e43b8f 2026-01-15 16:18:08 +0000 to 2026-01-23 13:50:59 +0000 - chore(deps): update cargo-semver-checks to v0.46.0 (rust-lang/cargo#16548) - Increase cache_lock test timeout (rust-lang/cargo#16545) - iTerm now supports OSC 9;4 (terminal window progress bar) (rust-lang/cargo#16506) - chore: Updated compiler errors for Rust 1.93 (rust-lang/cargo#16543) - test(build-std): adjust snapshot (rust-lang/cargo#16539) - chore: bump to 0.96.0 (rust-lang/cargo#16538) - fix: update `resolve_all_features()` to filter pkg deps (rust-lang/cargo#16221) - fix: show implicit_minimum_version_req emitted source once per package (rust-lang/cargo#16535) - fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang/cargo#16536) - feat(lints): Add non_kebab_case_bin lint (rust-lang/cargo#16524) - fix(rm): Suggest table flags when none are specified (rust-lang/cargo#16533) - fix(patch): clean up patch-related error messages (rust-lang/cargo#16498) - Store artifact deps in build unit dir (rust-lang/cargo#16519) - refactor(timings): reuse timing metric collection logic between `--timings` and `-Zbuild-analysis` (rust-lang/cargo#16497)
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.
A-manifest
Area: Cargo.toml issues
Command-add
Command-remove
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.
What does this PR try to resolve?
Improve the experience when someone does
cargo rm foobutfoois indev-dependenciesthat they don't need to look up--devby telling the user about the flag, particularly if clap moves forward with clap-rs/clap#6219 where--dev,--build, and--targetmight not be suggested to the user without the user knowing about them.Other error messages were improved along the way to match our desired style.
How to test and review this PR?
To have the subcommand context to know the flags, I switched to a structured error. To make this easier, I adjusted other error paths.