rustdoc: rustdoc -W help
prints error unless a file argument is given
#88756
Labels
C-bug
Category: This is a bug.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Uh oh!
There was an error while loading. Please reload this page.
Compiler lints can be printed with
rustc -W help
, with no filename arguments given. Unfortunately this doesn't work the same way forrustdoc
:If I pass it an arbitrary file, it will print any errors produced by parsing the file as rust. This includes errors from using
async
without passing--edition 2018
. This part is actually the same asrustc -W help
, in that passing arbitrary files to that produces the same behavior.If I pass it a file that parses cleanly (either 2015 rust, or 2018 rust with
--edition 2018
specified) then and only then willrustdoc -W help
actually print the lint groups. In this way it behaves similarly torustc -W help $filename
in thatrustc
will also print the lint groups when passed a filename that parses cleanly. The difference is thatrustc -W help
doesn't require a filename at all.The simplest workaround here is to type
rustdoc -W help /dev/null
as the empty/dev/null
file does not trigger any parse errors.Potential root cause
It's possible that the root cause here is that calling
rustdoc
with no args produces the same error:Compare this with
rustc
, which prints the help:This suggests that
rustdoc
is checking for filename arguments and erroring out early on, whereasrustc
skips that check and then later interprets "no filename args" as "fallback to help".Meta
The text was updated successfully, but these errors were encountered: