diff options
| author | Michael Goulet <michael@errs.io> | 2025-03-23 14:59:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-23 14:59:33 -0400 |
| commit | 21cdebcf4ecda073e7b2da47070687d12c1d585e (patch) | |
| tree | 9f2b31d4ecde416c725f25f3ae3df938f446c9dd /compiler/rustc_codegen_llvm/src/common.rs | |
| parent | bb49f0d8b66575443c942e72908f1846ad5b943d (diff) | |
| parent | f2cde8eeb4378b99cb722a9ef4a2f6cc83b805e1 (diff) | |
| download | rust-21cdebcf4ecda073e7b2da47070687d12c1d585e.tar.gz rust-21cdebcf4ecda073e7b2da47070687d12c1d585e.zip | |
Rollup merge of #138641 - jieyouxu:print-supported-crate-types, r=Urgau
Add unstable `--print=supported-crate-types` option
MCP: https://github.com/rust-lang/compiler-team/issues/836
Tracking issue: https://github.com/rust-lang/rust/issues/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
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
0 files changed, 0 insertions, 0 deletions
