Files
rust/tests/ui
Matthias Krüger b1d1e99c22 Rollup merge of #113780 - dtolnay:printkindpath, r=b-naber
Support `--print KIND=PATH` command line syntax

As is already done for `--emit KIND=PATH` and `-L KIND=PATH`.

In the discussion of #110785, it was pointed out that `--print KIND=PATH` is nicer than trying to apply the single global `-o` path to `--print`'s output, because in general there can be multiple print requests within a single rustc invocation, and anyway `-o` would already be used for a different meaning in the case of `link-args` and `native-static-libs`.

I am interested in using `--print cfg=PATH` in Buck2. Currently Buck2 works around the lack of support for `--print KIND=PATH` by [indirecting through a Python wrapper script](https://github.com/facebook/buck2/blob/d43cf3a51a31f00be2c2248e78271b0fef0452b4/prelude/rust/tools/get_rustc_cfg.py) to redirect rustc's stdout into the location dictated by the build system.

From skimming Cargo's usages of `--print`, it definitely seems like it would benefit from `--print KIND=PATH` too. Currently it is working around the lack of this by inserting `--crate-name=___ --print=crate-name` so that it can look for a line containing `___` as a delimiter between the 2 other `--print` informations it actually cares about. This is commented as a "HACK" and "abuse". https://github.com/rust-lang/cargo/blob/31eda6f7c360d9911f853b3014e057db61238f3e/src/cargo/core/compiler/build_context/target_info.rs#L242 (FYI `@weihanglo` as you dealt with this recently in https://github.com/rust-lang/cargo/pull/11633.)

Mentioning reviewers active in #110785: `@fee1-dead` `@jyn514` `@bjorn3`
2023-07-21 06:52:28 +02:00
..
2023-01-30 20:12:19 +00:00
2023-05-24 19:35:59 -03:00
2023-05-30 13:03:40 +02:00
2023-04-03 09:24:11 +02:00
2023-05-08 17:58:01 -03:00
2023-07-03 09:12:15 +02:00
2023-01-30 20:12:19 +00:00
2023-06-10 14:46:11 -04:00
2023-07-10 20:09:28 +00:00
2023-04-29 13:01:46 +01:00
2023-07-01 02:28:15 -04:00
2023-07-11 17:52:43 +08:00
2023-06-29 16:24:07 +03:00
2023-06-26 08:56:32 +00:00
2023-04-03 09:24:11 +02:00
2023-06-06 18:43:20 +00:00
2023-04-19 19:13:45 +00:00
2023-04-13 22:10:26 -05:00
2023-06-20 19:46:01 -04:00
2023-05-08 03:36:30 +00:00
2023-05-29 12:07:41 -03:00
2023-03-29 18:04:44 -04:00
2023-04-26 21:02:56 +02:00
2023-06-12 20:24:48 +08:00
2023-04-29 13:01:46 +01:00
2023-05-12 00:10:52 +00:00
2023-03-08 00:00:18 +00:00
2023-04-13 22:10:26 -05:00
2023-04-13 22:10:26 -05:00
2023-03-08 00:00:18 +00:00
2023-03-08 00:00:18 +00:00