Skip to content
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

rustc --print doesn't list valid options #128930

Closed
ChrisDenton opened this issue Aug 10, 2024 · 1 comment · Fixed by #128961 or #130473
Closed

rustc --print doesn't list valid options #128930

ChrisDenton opened this issue Aug 10, 2024 · 1 comment · Fixed by #128961 or #130473
Labels
A-CLI Area: Command-line interface (CLI) to the compiler C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ChrisDenton
Copy link
Member

I tried using rustc --print and found the error message is very terse:

> rustc --print
error: Argument to option 'print' missing

Using an invalid option does list the valid ones:

> rustc --print help
error: unknown print request: `help`
  |
  = help: valid print requests are: `all-target-specs-json`, `calling-conventions`, `cfg`, `check-cfg`, `code-models`, `crate-name`, `deployment-target`, `file-names`, `link-args`, `native-static-libs`, `relocation-models`, `split-debuginfo`, `stack-protector-strategies`, `sysroot`, `target-cpus`, `target-features`, `target-libdir`, `target-list`, `target-spec-json`, `tls-models`

rustc --version --verbose

rustc 1.82.0-nightly (8b3870784 2024-08-07)
binary: rustc
commit-hash: 8b3870784f69d8ed2ae4246d1b56f150e3131499
commit-date: 2024-08-07
host: x86_64-pc-windows-msvc
release: 1.82.0-nightly
LLVM version: 19.1.0
@ChrisDenton ChrisDenton added the A-CLI Area: Command-line interface (CLI) to the compiler label Aug 10, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 10, 2024
@GKFX
Copy link
Contributor

GKFX commented Aug 11, 2024

@rustbot label +T-compiler +C-enhancement -needs-triage

@rustbot rustbot added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 11, 2024
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this issue Sep 17, 2024
…option, r=jieyouxu

Fix rust-lang#128930: Print documentation of CLI options missing their arg

Fix rust-lang#128930. Failing to give an argument to CLI options which require it now prints something like:
```
$ rustc --print
error: Argument to option 'print' missing
       Usage:
           --print [crate-name|file-names|sysroot|target-libdir|cfg|check-cfg|calling-conventions|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|all-target-specs-json|native-static-libs|stack-protector-strategies|link-args|deployment-target]
                               Compiler information to print on stdout
```
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 17, 2024
…fee1-dead

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128961 (Fix rust-lang#128930: Print documentation of CLI options missing their arg)
 - rust-lang#129073 (Relate receiver invariantly in method probe for `Mode::Path`)
 - rust-lang#129674 (Add new_cyclic_in for Rc and Arc)
 - rust-lang#130201 (Encode `coroutine_by_move_body_def_id` in crate metadata)
 - rust-lang#130275 (Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error)
 - rust-lang#130440 (Don't ICE in `opaque_hidden_inferred_bound` lint for RPITIT in trait with no default method body)
 - rust-lang#130454 (tests: allow trunc/select instructions to be missing)
 - rust-lang#130458 (`rustc_codegen_ssa` cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 17, 2024
…option, r=jieyouxu

Fix rust-lang#128930: Print documentation of CLI options missing their arg

Fix rust-lang#128930. Failing to give an argument to CLI options which require it now prints something like:
```
$ rustc --print
error: Argument to option 'print' missing
       Usage:
           --print [crate-name|file-names|sysroot|target-libdir|cfg|check-cfg|calling-conventions|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|all-target-specs-json|native-static-libs|stack-protector-strategies|link-args|deployment-target]
                               Compiler information to print on stdout
```
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 17, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#128535 (Format `std::env::consts` docstrings with markdown backticks)
 - rust-lang#128961 (Fix rust-lang#128930: Print documentation of CLI options missing their arg)
 - rust-lang#129988 (Use `Vec` in `rustc_interface::Config::locale_resources`)
 - rust-lang#130201 (Encode `coroutine_by_move_body_def_id` in crate metadata)
 - rust-lang#130275 (Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error)
 - rust-lang#130314 (Use the same precedence for all macro-like exprs)
 - rust-lang#130440 (Don't ICE in `opaque_hidden_inferred_bound` lint for RPITIT in trait with no default method body)
 - rust-lang#130458 (`rustc_codegen_ssa` cleanups)
 - rust-lang#130469 (Mark `where_clauses_object_safety` as removed)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in 6360287 Sep 17, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 17, 2024
Rollup merge of rust-lang#128961 - GKFX:issue-128930-explain-missing-option, r=jieyouxu

Fix rust-lang#128930: Print documentation of CLI options missing their arg

Fix rust-lang#128930. Failing to give an argument to CLI options which require it now prints something like:
```
$ rustc --print
error: Argument to option 'print' missing
       Usage:
           --print [crate-name|file-names|sysroot|target-libdir|cfg|check-cfg|calling-conventions|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|all-target-specs-json|native-static-libs|stack-protector-strategies|link-args|deployment-target]
                               Compiler information to print on stdout
```
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 (CLI) to the compiler C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
3 participants