Skip to content

Commit 768129d

Browse files
Finish rustdoc error improvement
1 parent 70ced25 commit 768129d

File tree

5 files changed

+205
-31
lines changed

5 files changed

+205
-31
lines changed

src/librustdoc/config.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ impl RenderOptions {
311311
impl Options {
312312
/// Parses the given command-line for options. If an error message or other early-return has
313313
/// been printed, returns `Err` with the exit code.
314-
pub(crate) fn from_matches(matches: &getopts::Matches, args: Vec<String>) -> Result<Options, i32> {
314+
pub(crate) fn from_matches(
315+
matches: &getopts::Matches,
316+
args: Vec<String>,
317+
) -> Result<Options, i32> {
315318
let args = &args[1..];
316319
// Check for unstable options.
317320
nightly_options::check_nightly_options(matches, &opts());
@@ -432,7 +435,6 @@ impl Options {
432435
}
433436
return Err(0);
434437
}
435-
let (_lint_opts, _describe_lints, _lint_cap) = get_cmd_lint_options(matches, error_format);
436438

437439
if matches.free.is_empty() {
438440
diag.struct_err("missing file operand").emit();
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-include ../../run-make-fulldeps/tools.mk
22

33
all:
4-
$(BARE_RUSTDOC) 2>&1 | diff - output-default.stdout
4+
$(BARE_RUSTDOC) 2>&1 | sed -E 's@/nightly/|/beta/|/stable/|/1\.[0-9]+\.[0-9]+/@/$$CHANNEL/@g' | diff - output-default.stdout

src/test/run-make/issue-88756-default-output/output-default.stdout

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,4 @@ Options:
190190

191191
@path Read newline separated options from `path`
192192

193-
More information available at https://doc.rust-lang.org/nightly/rustdoc/what-is-rustdoc.html
193+
More information available at https://doc.rust-lang.org/$CHANNEL/rustdoc/what-is-rustdoc.html

src/test/run-make/issue-88756-opt-help/output-default.stdout

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
-W assume-incomplete-release=val -- make cfg(version) treat the current version as incomplete (default: no)
44
-W asm-comments=val -- generate comments into the assembly (may change behavior) (default: no)
55
-W assert-incr-state=val -- assert that the incremental cache is in given state: either `loaded` or `not-loaded`.
6-
-W ast-json=val -- print the AST as JSON and halt (default: no)
7-
-W ast-json-noexpand=val -- print the pre-expansion AST as JSON and halt (default: no)
86
-W binary-dep-depinfo=val -- include artifacts (sysroot, crate dependencies) used during compilation in dep-info (default: no)
9-
-W borrowck=val -- select which borrowck is used (`mir` or `migrate`) (default: `migrate`)
107
-W branch-protection=val -- set options for branch target identification and pointer authentication on AArch64
118
-W cf-protection=val -- instrument control-flow architecture protection
129
-W cgu-partitioning-strategy=val -- the codegen unit partitioning strategy to use
@@ -133,12 +130,17 @@
133130
for example: `-Z self-profile-events=default,query-keys`
134131
all options: none, all, default, generic-activity, query-provider, query-cache-hit
135132
query-blocked, incr-cache-load, incr-result-hashing, query-keys, function-args, args, llvm, artifact-sizes
133+
-W self-profile-counter=val -- counter used by the self profiler (default: `wall-time`), one of:
134+
`wall-time` (monotonic clock, i.e. `std::time::Instant`)
135+
`instructions:u` (retired instructions, userspace-only)
136+
`instructions-minus-irqs:u` (subtracting hardware interrupt counts for extra accuracy)
136137
-W share-generics=val -- make the current crate share its generic instantiations
137138
-W show-span=val -- show spans for compiler debugging (expr|pat|ty)
138139
-W span-debug=val -- forward proc_macro::Span's `Debug` impl to `Span`
139140
-W span-free-formats=val -- exclude spans when debug-printing compiler state (default: no)
140141
-W src-hash-algorithm=val -- hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)
141142
-W stack-protector=val -- control stack smash protection strategy (`rustc --print stack-protector-strategies` for details)
143+
-W strict-init-checks=val -- control if mem::uninitialized and mem::zeroed panic on more UB
142144
-W strip=val -- tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)
143145
-W split-dwarf-kind=val -- split dwarf variant (only if -Csplit-debuginfo is enabled and on relevant platform)
144146
(default: `split`)
@@ -164,6 +166,7 @@
164166
-W time-passes=val -- measure time of each rustc pass (default: no)
165167
-W tls-model=val -- choose the TLS model to use (`rustc --print tls-models` for details)
166168
-W trace-macros=val -- for every macro invocation, print its name and arguments (default: no)
169+
-W translate-remapped-path-to-local-path=val -- translate remapped paths into local paths when possible (default: yes)
167170
-W trap-unreachable=val -- generate trap instructions for unreachable intrinsics (default: use target setting, usually yes)
168171
-W treat-err-as-bug=val -- treat error number `val` that occurs as bug
169172
-W trim-diagnostic-paths=val -- in diagnostics, use heuristics to shorten paths referring to items
@@ -186,4 +189,5 @@
186189
-W validate-mir=val -- validate MIR after each transformation
187190
-W verbose=val -- in general, enable more debug printouts (default: no)
188191
-W verify-llvm-ir=val -- verify LLVM IR (default: no)
192+
-W virtual-function-elimination=val -- enables dead virtual function elimination optimization. Requires `-Clto[=[fat,yes]]`
189193
-W wasi-exec-model=val -- whether to build a wasi command or reactor

0 commit comments

Comments
 (0)