-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
base: master
Are you sure you want to change the base?
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. |
…s, 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 ![image](https://github.com/user-attachments/assets/4922e4e5-eeca-40cd-ac1c-1c6319a81aee) ### After ![image](https://github.com/user-attachments/assets/67ea1f35-aa41-4e4f-8691-47c273d0cff9) I based the implementation on `OutputType::shorthands_display` Closes rust-lang#70183
⌛ Testing commit b56ec2f with merge a1a97f8b45542f1025e789626a889499c13aa9d9... |
💔 Test failed - checks-actions |
Looks like Cargo tests (possibly other tools too) will need some blessing/manual updatimg |
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