Skip to content

Commit 9594e97

Browse files
committed
Specify --print info=file syntax in --help
1 parent 5961e5b commit 9594e97

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

Diff for: compiler/rustc_session/src/config.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -1560,9 +1560,10 @@ The default is {DEFAULT_EDITION} and the latest stable edition is {LATEST_STABLE
15601560
)
15611561
});
15621562

1563-
static PRINT_KINDS_STRING: LazyLock<String> = LazyLock::new(|| {
1563+
static PRINT_HELP: LazyLock<String> = LazyLock::new(|| {
15641564
format!(
1565-
"[{}]",
1565+
"Compiler information to print on stdout (or to a file)\n\
1566+
INFO may be one of ({}).",
15661567
PRINT_KINDS.iter().map(|(name, _)| format!("{name}")).collect::<Vec<_>>().join("|")
15671568
)
15681569
});
@@ -1621,14 +1622,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
16211622
"Comma separated list of types of output for the compiler to emit",
16221623
"[asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]",
16231624
),
1624-
opt(
1625-
Stable,
1626-
Multi,
1627-
"",
1628-
"print",
1629-
"Compiler information to print on stdout",
1630-
&PRINT_KINDS_STRING,
1631-
),
1625+
opt(Stable, Multi, "", "print", &PRINT_HELP, "INFO[=FILE]"),
16321626
opt(Stable, FlagMulti, "g", "", "Equivalent to -C debuginfo=2", ""),
16331627
opt(Stable, FlagMulti, "O", "", "Equivalent to -C opt-level=3", ""),
16341628
opt(Stable, Opt, "o", "", "Write output to <filename>", "FILENAME"),

Diff for: tests/run-make/rustc-help/help-v.diff

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -51,10 +51,27 @@
1+
@@ -53,10 +53,27 @@
22
Set a codegen option
33
-V, --version Print version info and exit
44
-v, --verbose Use verbose output

Diff for: tests/run-make/rustc-help/help-v.stdout

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ Options:
2929
--emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]
3030
Comma separated list of types of output for the
3131
compiler to emit
32-
--print [all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models]
33-
Compiler information to print on stdout
32+
--print INFO[=FILE]
33+
Compiler information to print on stdout (or to a file)
34+
INFO may be one of
35+
(all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models).
3436
-g Equivalent to -C debuginfo=2
3537
-O Equivalent to -C opt-level=3
3638
-o FILENAME Write output to <filename>

Diff for: tests/run-make/rustc-help/help.stdout

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ Options:
2929
--emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]
3030
Comma separated list of types of output for the
3131
compiler to emit
32-
--print [all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models]
33-
Compiler information to print on stdout
32+
--print INFO[=FILE]
33+
Compiler information to print on stdout (or to a file)
34+
INFO may be one of
35+
(all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models).
3436
-g Equivalent to -C debuginfo=2
3537
-O Equivalent to -C opt-level=3
3638
-o FILENAME Write output to <filename>

0 commit comments

Comments
 (0)