mirror of
https://github.com/rust-lang/cargo
synced 2024-10-02 22:13:47 +00:00
Add cargo rustc --print
unstable docs.
This commit is contained in:
parent
dda0d65b39
commit
abbd2b0bb1
|
@ -75,7 +75,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
|
|||
if let Some(opt_value) = args.value_of(PRINT_ARG_NAME) {
|
||||
config
|
||||
.cli_unstable()
|
||||
.fail_if_stable_opt(PRINT_ARG_NAME, 8923)?;
|
||||
.fail_if_stable_opt(PRINT_ARG_NAME, 9357)?;
|
||||
ops::print(&ws, &compile_opts, opt_value)?;
|
||||
} else {
|
||||
ops::compile(&ws, &compile_opts)?;
|
||||
|
|
|
@ -1248,6 +1248,20 @@ from the root of the workspace. It also passes the `--test-run-directory` to
|
|||
package. This preserves backwards compatibility and is consistent with how
|
||||
normal unittests are run.
|
||||
|
||||
### rustc `--print`
|
||||
|
||||
* Tracking Issue: [#9357](https://github.com/rust-lang/cargo/issues/9357)
|
||||
|
||||
`cargo rustc --print=VAL` forwards the `--print` flag to `rustc` in order to
|
||||
extract information from `rustc`. This runs `rustc` with the corresponding
|
||||
[`--print`](https://doc.rust-lang.org/rustc/command-line-arguments.html#--print-print-compiler-information)
|
||||
flag, and then immediately exits without compiling. Exposing this as a cargo
|
||||
flag allows cargo to inject the correct target and RUSTFLAGS based on the
|
||||
current configuration.
|
||||
|
||||
The primary use case is to run `cargo rustc --print=cfg` to get config values
|
||||
for the appropriate target and influenced by any other RUSTFLAGS.
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var fragments = {
|
||||
|
|
Loading…
Reference in a new issue