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 {
75
75
if let Some ( opt_value) = args. value_of ( PRINT_ARG_NAME ) {
76
76
config
77
77
. cli_unstable ( )
78
- . fail_if_stable_opt ( PRINT_ARG_NAME , 8923 ) ?;
78
+ . fail_if_stable_opt ( PRINT_ARG_NAME , 9357 ) ?;
79
79
ops:: print ( & ws, & compile_opts, opt_value) ?;
80
80
} else {
81
81
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
1248
1248
package. This preserves backwards compatibility and is consistent with how
1249
1249
normal unittests are run.
1250
1250
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
+
1251
1265
<script >
1252
1266
(function () {
1253
1267
var fragments = {
You can’t perform that action at this time.
0 commit comments