-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Display valid crate types in error message for --crate-type flag #134720
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BoxyUwU (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
I seem to recall not all the targets support all the crate types. For example, does all of the wasm targets support Though I suppose the user will get another follow-up error anyway 😄 |
You're right 🙂 This error is just to show the valid values for |
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.
Can you add an ui test for this diagnostics?
Hi, I added the tests. I'm not sure if I did it the right way, though. |
980ca14
to
62353f8
Compare
The UI test looks good. You'll should squash all your changes into one commit |
a60dbd4
to
6315245
Compare
Done 👍 |
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.
Thanks, this looks like a nice improvement, only some tiny stylistic nits, then LGTM.
Thanks, I'll r+ after PR CI is green. |
This comment has been minimized.
This comment has been minimized.
(You might need to rebless the test) |
Also, can you squash the commits into one? Thanks. |
9a2ef0a
to
b56ec2f
Compare
Cool. |
Thanks for the reminder, I missed the cargo bump. @bors r+ rollup |
…ues, r=jieyouxu Display valid crate types in error message for --crate-type flag This PR improves the error message for the --crate-type flag. When an invalid crate type is provided, the compiler will now show a list of valid options. ### Before  ### After  I based the implementation on `OutputType::shorthands_display` Closes rust-lang#70183
@bors r- presumptive (partial) cause of #135181 (comment) |
Ah right, I added a new test, may have to rebless it |
This comment has been minimized.
This comment has been minimized.
@malezjaa
|
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
0d5087d
to
90bf2b1
Compare
I reblessed the test, no significant changes. |
…ues, r=jieyouxu Display valid crate types in error message for --crate-type flag This PR improves the error message for the --crate-type flag. When an invalid crate type is provided, the compiler will now show a list of valid options. ### Before  ### After  I based the implementation on `OutputType::shorthands_display` Closes rust-lang#70183
Rollup of 6 pull requests Successful merges: - rust-lang#134720 (Display valid crate types in error message for --crate-type flag) - rust-lang#137424 (uefi: helpers: Add DevicePathNode abstractions) - rust-lang#137736 (Don't attempt to export compiler-builtins symbols from rust dylibs) - rust-lang#138451 (Build GCC on CI with GCC, not Clang) - rust-lang#138454 (Improve post-merge workflow) - rust-lang#138477 (Deny impls for `BikeshedGuaranteedNoDrop`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang#134720 (Display valid crate types in error message for --crate-type flag) - rust-lang#137619 (Provide helpful diagnostics for shebang lookalikes) - rust-lang#138353 (remove must_use from <*const T>::expose_provenance) - rust-lang#138452 (Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`) - rust-lang#138469 (remove comment regarding a removed test directive) - rust-lang#138477 (Deny impls for `BikeshedGuaranteedNoDrop`) - rust-lang#138485 (Rustc dev guide subtree update) - rust-lang#138487 (Pass `CI_JOB_DOC_URL` to Docker) - rust-lang#138495 (Take a break from reviews) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#134720 - malezjaa:feat/crate-type-valid-values, r=jieyouxu Display valid crate types in error message for --crate-type flag This PR improves the error message for the --crate-type flag. When an invalid crate type is provided, the compiler will now show a list of valid options. ### Before  ### After  I based the implementation on `OutputType::shorthands_display` Closes rust-lang#70183
Rollup of 9 pull requests Successful merges: - rust-lang#134720 (Display valid crate types in error message for --crate-type flag) - rust-lang#137619 (Provide helpful diagnostics for shebang lookalikes) - rust-lang#138353 (remove must_use from <*const T>::expose_provenance) - rust-lang#138452 (Remove `RUN_CHECK_WITH_PARALLEL_QUERIES`) - rust-lang#138469 (remove comment regarding a removed test directive) - rust-lang#138477 (Deny impls for `BikeshedGuaranteedNoDrop`) - rust-lang#138485 (Rustc dev guide subtree update) - rust-lang#138487 (Pass `CI_JOB_DOC_URL` to Docker) - rust-lang#138495 (Take a break from reviews) r? `@ghost` `@rustbot` modify labels: rollup
This PR improves the error message for the --crate-type flag. When an invalid crate type is provided, the compiler will now show a list of valid options.
Before
After
I based the implementation on
OutputType::shorthands_display
Closes #70183