Skip to content

Commit

Permalink
Auto merge of #114144 - workingjubilee:rollup-jkmtgdo, r=workingjubilee
Browse files Browse the repository at this point in the history
Rollup of 4 pull requests

Successful merges:

 - #97571 (Add documentation on v0 symbol mangling.)
 - #114122 (tests/ui/hello_world/main.rs: Remove FIXME (#62277))
 - #114133 (Revert "add tidy check that forbids issue ui test filenames")
 - #114139 (Make `--print` with path unstable)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jul 27, 2023
2 parents 0be1152 + b457992 commit 500647f
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 4,338 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2152,6 +2152,12 @@ fn collect_print_requests(
prints.extend(matches.opt_strs("print").into_iter().map(|req| {
let (req, out) = split_out_file_name(&req);

if out.is_some() && !unstable_opts.unstable_options {
handler.early_error(
"the `-Z unstable-options` flag must also be passed to \
enable the path print option",
);
}
let kind = match PRINT_KINDS.iter().find(|&&(name, _)| name == req) {
Some((_, PrintKind::TargetSpec)) => {
if unstable_opts.unstable_options {
Expand Down
4 changes: 0 additions & 4 deletions src/doc/rustc/src/command-line-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ The valid types of print values are:
This returns rustc's minimum supported deployment target if no `*_DEPLOYMENT_TARGET` variable
is present in the environment, or otherwise returns the variable's parsed value.

A filepath may optionally be specified for each requested information kind, in
the format `--print KIND=PATH`, just like for `--emit`. When a path is
specified, information will be written there instead of to stdout.

[conditional compilation]: ../reference/conditional-compilation.html
[deployment target]: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html

Expand Down
11 changes: 11 additions & 0 deletions src/doc/unstable-book/src/compiler-flags/path-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `--print` Options

The behavior of the `--print` flag can be modified by optionally be specifiying a filepath
for each requested information kind, in the format `--print KIND=PATH`, just like for
`--emit`. When a path is specified, information will be written there instead of to stdout.

This is unstable feature, so you have to provide `-Zunstable-options` to enable it.

## Examples

`rustc main.rs -Z unstable-options --print cfg=cfgs.txt`
Loading

0 comments on commit 500647f

Please sign in to comment.