Closed
Description
If you type the wrong target name, Cargo presents a rather terse error message:
> cargo run --bin foo
error: no bin target named `foo`
If the typo detection works, then it will provide a suggestion; but if it does not, then it doesn't print anything.
It would be helpful if cargo provided a list of valid target names. There are two similar cases where it does that:
> cargo run
error: `cargo run` could not determine which binary to run. Use the `--bin` option to specify a binary, or the `default-run` manifest key.
available binaries: abc, xyz
or
> cargo run --bin
error: "--bin" takes one argument.
Available binaries:
abc
xyz
I think the case where the typo detection fails, it should just list all the target names, similar to those two other error messages.
Here is where this code lives.
cargo 1.65.0-nightly (ce40690a5 2022-08-09)