Skip to content

rustc --crate-type flag should display valid values #70183

Closed
@disconnect3d

Description

@disconnect3d

Hello,

When we provide wrong value for the --emit flag, we will get a list of valid values. This is not the case for --crate-type flag, which should also display valid values.

The --emit example:

$ cargo rustc -- --emit=asd
   Compiling tokio v0.2.13 (/host/tokio/tokio)
error: unknown emission type: `asd` - expected one of: `llvm-bc`, `asm`, `llvm-ir`, `mir`, `obj`, `metadata`, `link`, `dep-info`

The --crate-type example:

$ cargo rustc -- --crate-type=dynlib
   Compiling tokio v0.2.13 (/host/tokio/tokio)
error: unknown crate type: `dynlib`

error: could not compile `tokio`.

To learn more, run the command again with --verbose.

Versions:

$ cargo --version
cargo 1.41.0 (626f0f40e 2019-12-03)
r$ rustc --version
rustc 1.41.0 (5e1a79984 2020-01-27)

I have also tested this on rustc 1.42.0 and it is the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: Command-line interface (CLI) to the compilerA-diagnosticsArea: Messages for errors, warnings, and lintsD-papercutDiagnostics: An error or lint that needs small tweaks.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions