Files
rust/compiler/rustc_driver_impl/src
Jonathan Brouwer 549f475a13 Rollup merge of #151618 - ShE3py:rustdoc-print, r=notriddle
rustdoc: add `--print` option

Context: `--print crate-root-lint-levels` (rust-lang/rust#139180) is only available for `rustc` and `clippy-driver`, while it would make sense for it to also be available for `rustdoc` (à la rust-lang/rust#83895.)

Not too sure about the stability of `rustdoc --print=any` or if this needs a MCP; strictly speaking, only `rustdoc +nightly -Z unstable-options --print=crate-root-lint-levels` would be required (and the `rustdoc --print` would be stabilized together with `crate-root-lint-levels`), but I guess that makes sense to have all the `--print`s for consistency.

For regression tests, not sure if ui or run-make is preferable, as run-make would need some sort of trait to avoid duplicating code between `rustc()` and `rustdoc()` (or just test `rustdoc` as it delegates to `rustc`):
021fc25b7a/tests/run-make/print-crate-root-lint-levels/rmake.rs (L82-L88)

@rustbot label +A-CLI +A-print-requests
2026-09-01 21:26:10 +02:00
..
2025-09-19 20:56:07 +00:00