]> git.proxmox.com Git - cargo.git/commitdiff
Add crate-type unstable doc
authorhi-rustin <rustin.liu@gmail.com>
Tue, 23 Nov 2021 15:21:39 +0000 (23:21 +0800)
committerhi-rustin <rustin.liu@gmail.com>
Tue, 23 Nov 2021 15:21:39 +0000 (23:21 +0800)
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
src/doc/src/reference/unstable.md

index a5b2077b6b608a75381dd9088d8eb865aebabd29..6b254fd32970949d96dbe3bd1dc953ef18dca631 100644 (file)
@@ -83,6 +83,7 @@ Each new feature described below should explain how to use it.
     * [build-std-features](#build-std-features) — Sets features to use with the standard library.
     * [binary-dep-depinfo](#binary-dep-depinfo) — Causes the dep-info file to track binary dependencies.
     * [panic-abort-tests](#panic-abort-tests) — Allows running tests with the "abort" panic strategy.
+    * [crate-type](#crate-type) - Supports passing crate types to the compiler.
 * rustdoc
     * [`doctest-in-workspace`](#doctest-in-workspace) — Fixes workspace-relative paths when running doctests.
     * [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!
 
 [rust-lang/rust#64158]: https://github.com/rust-lang/rust/pull/64158
 
+### crate-type
+* Tracking Issue: [#10083](https://github.com/rust-lang/cargo/issues/10083)
+* RFC: [#3180](https://github.com/rust-lang/rfcs/pull/3180)
+* Original Pull Request: [#10093](https://github.com/rust-lang/cargo/pull/10093)
+
+`cargo rustc --crate-type=lib,cdylib` forwards the `--crate-type` flag to `rustc`.
+This runs `rustc` with the corresponding
+[`--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)
+flag, and compiling.
+
+When using it, it requires the `-Z unstable-options`
+command-line option:
+
+```console
+cargo rustc --crate-type lib,cdylib -Z unstable-options
+```
+
 ### config-cli
 * Tracking Issue: [#7722](https://github.com/rust-lang/cargo/issues/7722)