File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
7575 if let Some ( opt_value) = args. value_of ( PRINT_ARG_NAME ) {
7676 config
7777 . cli_unstable ( )
78- . fail_if_stable_opt ( PRINT_ARG_NAME , 8923 ) ?;
78+ . fail_if_stable_opt ( PRINT_ARG_NAME , 9357 ) ?;
7979 ops:: print ( & ws, & compile_opts, opt_value) ?;
8080 } else {
8181 ops:: compile ( & ws, & compile_opts) ?;
Original file line number Diff line number Diff line change @@ -1248,6 +1248,20 @@ from the root of the workspace. It also passes the `--test-run-directory` to
12481248package. This preserves backwards compatibility and is consistent with how
12491249normal unittests are run.
12501250
1251+ ### rustc ` --print `
1252+
1253+ * Tracking Issue: [ #9357 ] ( https://github.com/rust-lang/cargo/issues/9357 )
1254+
1255+ ` cargo rustc --print=VAL ` forwards the ` --print ` flag to ` rustc ` in order to
1256+ extract information from ` rustc ` . This runs ` rustc ` with the corresponding
1257+ [ ` --print ` ] ( https://doc.rust-lang.org/rustc/command-line-arguments.html#--print-print-compiler-information )
1258+ flag, and then immediately exits without compiling. Exposing this as a cargo
1259+ flag allows cargo to inject the correct target and RUSTFLAGS based on the
1260+ current configuration.
1261+
1262+ The primary use case is to run ` cargo rustc --print=cfg ` to get config values
1263+ for the appropriate target and influenced by any other RUSTFLAGS.
1264+
12511265<script >
12521266(function () {
12531267 var fragments = {
You can’t perform that action at this time.
0 commit comments