Skip to content

Commit 137f9bc

Browse files
committed
Add crate-type unstable doc
Signed-off-by: hi-rustin <[email protected]>
1 parent 660ce6b commit 137f9bc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/doc/src/reference/unstable.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Each new feature described below should explain how to use it.
8383
* [build-std-features](#build-std-features) — Sets features to use with the standard library.
8484
* [binary-dep-depinfo](#binary-dep-depinfo) — Causes the dep-info file to track binary dependencies.
8585
* [panic-abort-tests](#panic-abort-tests) — Allows running tests with the "abort" panic strategy.
86+
* [crate-type](#crate-type) - Supports passing crate types to the compiler.
8687
* rustdoc
8788
* [`doctest-in-workspace`](#doctest-in-workspace) — Fixes workspace-relative paths when running doctests.
8889
* [rustdoc-map](#rustdoc-map) — Provides mappings for documentation to link to external sites like [docs.rs](https://docs.rs/).
@@ -555,6 +556,23 @@ like to stabilize it somehow!
555556

556557
[rust-lang/rust#64158]: https://github.com/rust-lang/rust/pull/64158
557558

559+
### crate-type
560+
* Tracking Issue: [#10083](https://github.com/rust-lang/cargo/issues/10083)
561+
* RFC: [#3180](https://github.com/rust-lang/rfcs/pull/3180)
562+
* Original Pull Request: [#10093](https://github.com/rust-lang/cargo/pull/10093)
563+
564+
`cargo rustc --crate-type=lib,cdylib` forwards the `--crate-type` flag to `rustc`.
565+
This runs `rustc` with the corresponding
566+
[`--crate-type`](https://doc.rust-lang.org/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit)
567+
flag, and compiling.
568+
569+
When using it, it requires the `-Z unstable-options`
570+
command-line option:
571+
572+
```console
573+
cargo rustc --crate-type lib,cdylib -Z unstable-options
574+
```
575+
558576
### config-cli
559577
* Tracking Issue: [#7722](https://github.com/rust-lang/cargo/issues/7722)
560578

0 commit comments

Comments
 (0)