]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomez
authorbors <bors@rust-lang.org>
Mon, 5 Nov 2018 09:48:46 +0000 (09:48 +0000)
committerbors <bors@rust-lang.org>
Mon, 5 Nov 2018 09:48:46 +0000 (09:48 +0000)
rustdoc: refactor: centralize all command-line argument parsing

This is something i've wanted to do for a while, since we keep having to add new arguments to places like `rust_input` or `core::run_core` whenever we add a new CLI flag or the like. Those functions have inflated up to 11-19, and in some cases hiding away the locations where some CLI flags were being parsed, obscuring their use. Now, we have a central place where all command-line configuration occurs, including argument validation.

One note about the design: i grouped together all the arguments that `html::render::run` needed, so that i could pass them on from compilation in one lump instead of trying to thread through individual items or clone the entire blob ahead of time.

One other thing this adds is that rustdoc also now recognizes all the `-Z` options that rustc does, since we were manually grabbing a few previously. Now we parse a full `DebuggingOptions` struct and hand it directly to rustc when scraping docs.

1  2 
src/librustdoc/html/render.rs
src/librustdoc/test.rs

Simple merge
Simple merge