-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
rustdoc: add --print option
#151618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
rustdoc: add --print option
#151618
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -542,6 +542,14 @@ fn opts() -> Vec<RustcOptGroup> { | |
| "Comma separated list of types of output for rustdoc to emit", | ||
| "[toolchain-shared-resources,invocation-specific,dep-info]", | ||
| ), | ||
| opt( | ||
| Unstable, | ||
| Multi, | ||
| "", | ||
| "print", | ||
| "Rustdoc information to print on stdout (or to a file)", | ||
| "<INFO>[=<FILE>]", | ||
| ), | ||
| opt(Unstable, FlagMulti, "", "no-run", "Compile doctests without running them", ""), | ||
| opt( | ||
| Unstable, | ||
|
|
@@ -885,6 +893,12 @@ fn main_args(early_dcx: &mut EarlyDiagCtxt, at_args: &[String]) { | |
| return; | ||
| } | ||
|
|
||
| if rustc_driver::print_crate_info(&*compiler.codegen_backend, sess, true) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: IINM, this won't be run if the input file is
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moreover, |
||
| == rustc_driver::Compilation::Stop | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| let krate = rustc_interface::passes::parse(sess); | ||
| rustc_interface::create_and_enter_global_ctxt(compiler, krate, |tcx| { | ||
| if sess.dcx().has_errors().is_some() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was changed from
env!tooption_env!in the first commit of #13724, but not sure why this change was made or if it's still relevant as CI is green.(Was looking looking for a
#[expect]reason as removing the extra parentheses triggers deny-by-defaultclippy::option_env_unwrap)