-
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
Add unstable --print=supported-crate-types
option
#138641
Conversation
This comment has been minimized.
This comment has been minimized.
@rustbot ready |
9448784
to
ef06252
Compare
Really looking forward to using this in Cargo. Thank you folks! |
☔ The latest upstream changes (presumably #138747) made this pull request unmergeable. Please resolve the merge conflicts. |
ef06252
to
675bfeb
Compare
Reblessed tests due to extra help line. |
This comment has been minimized.
This comment has been minimized.
//@ check-fail | ||
//@ compile-flags: /dev/null --print lints |
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.
I was a bit confused by this test, it turns out we are checking for the -Whelp
suggestion if the invalid print request --print=lints
was specified.
//@ error-pattern: error: unknown print request: `lints` | ||
//@ error-pattern: help: use `-Whelp` to print a list of lints | ||
//@ error-pattern: help: for more information, see the rustc book |
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.
Ensure that the test intention can't be accidentally blessed away as easily.
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.
LGTM
r? Urgau |
…es, r=Urgau Add unstable `--print=supported-crate-types` option MCP: rust-lang/compiler-team#836 Tracking issue: rust-lang#138640 ### Test coverage Two tests: 1. `tests/ui/print-request/stability.rs` to check that `--print=supported-crate-types` is `-Zunstable-options`-gated 2. `tests/ui/print-request/supported-crate-types.rs` is added as a basic smoke test. Observe that the compiler stdout corresponds to the below *Example output* section (e.g. `proc-macro` is unsupported on `wasm32-unknown-unknown` currently). ### Example output <details> <summary>For `x86_64-unknown-linux-gnu`</summary> Notice the presence of `{c,}dylib` and `proc-macro`: ``` bin cdylib dylib lib proc-macro rlib staticlib ``` </details> <details> <summary>For `wasm32-unknown-unknown`</summary> Notice the absence of `dylib` and `proc-macro`: ``` bin cdylib lib rlib staticlib ``` </details> <details> <summary>For `x86_64-unknown-linux-musl`</summary> Notice the absence of `{c,}dylib` but presence of `proc-macro`: ``` bin lib proc-macro rlib staticlib ``` </details> ### Documentation I added an entry in the unstable book's print request section to document this `supported-crate-types` print request. ### Unresolved questions - [ ] (Name bikeshedding) is `supported-crate-types` a good name for the print request? I'm inclined to say it's good enough for an unstable print request, but may be worth revisiting at stabilization time. ### Stability This print request being added is *unstable* in this PR. A separate stabilization PR following the usual compiler flag stabilization procedure should be filed for stabilization after some baking time. ### Review remarks Best reviewed commit-by-commit. r? compiler
Rollup of 9 pull requests Successful merges: - rust-lang#138236 (uefi: Add OwnedEvent abstraction) - rust-lang#138293 (rustdoc: Gate unstable `doc(cfg())` predicates) - rust-lang#138509 (Add test to ensure no index out of bounds panic (rust-lang#135474)) - rust-lang#138602 (Slim `rustc_parse_format` dependencies down) - rust-lang#138631 (Update test for SGX now implementing `read_buf`) - rust-lang#138641 (Add unstable `--print=supported-crate-types` option) - rust-lang#138662 (Implement some basics in UEFI fs) - rust-lang#138837 (resolve: Avoid remaining unstable iteration) - rust-lang#138849 (doc: rename reference #create-a-configtoml to #create-a-bootstraptoml) Failed merges: - rust-lang#138755 ([rustdoc] Remove duplicated loop when computing doc cfgs) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
Yes, it's because I wrote |
As an unstable print request.
- Document test intent to check for `-Whelp` suggestion if `--print=lints` was specified. - Move this test under `tests/ui/print-request/` and rename it to `print-lints-help.rs` to better reflect what it is checking.
405d1c4
to
f2cde8e
Compare
Fixed the llvm component name. |
…mpiler-errors Rollup of 12 pull requests Successful merges: - rust-lang#136040 (Remove unused trait BoundedSize) - rust-lang#138236 (uefi: Add OwnedEvent abstraction) - rust-lang#138293 (rustdoc: Gate unstable `doc(cfg())` predicates) - rust-lang#138509 (Add test to ensure no index out of bounds panic (rust-lang#135474)) - rust-lang#138545 (Add MIR pre-codegen tests to track rust-lang#138544) - rust-lang#138631 (Update test for SGX now implementing `read_buf`) - rust-lang#138641 (Add unstable `--print=supported-crate-types` option) - rust-lang#138667 (std: uefi: fs: Implement mkdir) - rust-lang#138849 (doc: rename reference #create-a-configtoml to #create-a-bootstraptoml) - rust-lang#138854 (Fix ICE rust-lang#138415 for invalid extern function body) - rust-lang#138858 (Say which test failed the `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` assertion) - rust-lang#138861 (Tweak type flags, fix missing flags from coroutine kind ty) Failed merges: - rust-lang#138755 ([rustdoc] Remove duplicated loop when computing doc cfgs) r? `@ghost` `@rustbot` modify labels: rollup
…mpiler-errors Rollup of 12 pull requests Successful merges: - rust-lang#136040 (Remove unused trait BoundedSize) - rust-lang#138236 (uefi: Add OwnedEvent abstraction) - rust-lang#138293 (rustdoc: Gate unstable `doc(cfg())` predicates) - rust-lang#138509 (Add test to ensure no index out of bounds panic (rust-lang#135474)) - rust-lang#138545 (Add MIR pre-codegen tests to track rust-lang#138544) - rust-lang#138631 (Update test for SGX now implementing `read_buf`) - rust-lang#138641 (Add unstable `--print=supported-crate-types` option) - rust-lang#138667 (std: uefi: fs: Implement mkdir) - rust-lang#138849 (doc: rename reference #create-a-configtoml to #create-a-bootstraptoml) - rust-lang#138854 (Fix ICE rust-lang#138415 for invalid extern function body) - rust-lang#138858 (Say which test failed the `COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS` assertion) - rust-lang#138861 (Tweak type flags, fix missing flags from coroutine kind ty) Failed merges: - rust-lang#138755 ([rustdoc] Remove duplicated loop when computing doc cfgs) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138641 - jieyouxu:print-supported-crate-types, r=Urgau Add unstable `--print=supported-crate-types` option MCP: rust-lang/compiler-team#836 Tracking issue: rust-lang#138640 ### Test coverage Two tests: 1. `tests/ui/print-request/stability.rs` to check that `--print=supported-crate-types` is `-Zunstable-options`-gated 2. `tests/ui/print-request/supported-crate-types.rs` is added as a basic smoke test. Observe that the compiler stdout corresponds to the below *Example output* section (e.g. `proc-macro` is unsupported on `wasm32-unknown-unknown` currently). ### Example output <details> <summary>For `x86_64-unknown-linux-gnu`</summary> Notice the presence of `{c,}dylib` and `proc-macro`: ``` bin cdylib dylib lib proc-macro rlib staticlib ``` </details> <details> <summary>For `wasm32-unknown-unknown`</summary> Notice the absence of `dylib` and `proc-macro`: ``` bin cdylib lib rlib staticlib ``` </details> <details> <summary>For `x86_64-unknown-linux-musl`</summary> Notice the absence of `{c,}dylib` but presence of `proc-macro`: ``` bin lib proc-macro rlib staticlib ``` </details> ### Documentation I added an entry in the unstable book's print request section to document this `supported-crate-types` print request. ### Unresolved questions - [ ] (Name bikeshedding) is `supported-crate-types` a good name for the print request? I'm inclined to say it's good enough for an unstable print request, but may be worth revisiting at stabilization time. ### Stability This print request being added is *unstable* in this PR. A separate stabilization PR following the usual compiler flag stabilization procedure should be filed for stabilization after some baking time. ### Review remarks Best reviewed commit-by-commit. r? compiler
MCP: rust-lang/compiler-team#836
Tracking issue: #138640
Test coverage
Two tests:
tests/ui/print-request/stability.rs
to check that--print=supported-crate-types
is-Zunstable-options
-gatedtests/ui/print-request/supported-crate-types.rs
is added as a basic smoke test. Observe that the compiler stdout corresponds to the below Example output section (e.g.proc-macro
is unsupported onwasm32-unknown-unknown
currently).Example output
For `x86_64-unknown-linux-gnu`
Notice the presence of
{c,}dylib
andproc-macro
:For `wasm32-unknown-unknown`
Notice the absence of
dylib
andproc-macro
:For `x86_64-unknown-linux-musl`
Notice the absence of
{c,}dylib
but presence ofproc-macro
:Documentation
I added an entry in the unstable book's print request section to document this
supported-crate-types
print request.Unresolved questions
supported-crate-types
a good name for the print request? I'm inclined to say it's good enough for an unstable print request, but may be worth revisiting at stabilization time.Stability
This print request being added is unstable in this PR. A separate stabilization PR following the usual compiler flag stabilization procedure should be filed for stabilization after some baking time.
Review remarks
Best reviewed commit-by-commit.
r? compiler