summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/config.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /src/librustdoc/config.rs
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/librustdoc/config.rs')
-rw-r--r--src/librustdoc/config.rs22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs
index 2c514a0c8..1be4f364e 100644
--- a/src/librustdoc/config.rs
+++ b/src/librustdoc/config.rs
@@ -1,12 +1,10 @@
use std::collections::BTreeMap;
-use std::convert::TryFrom;
use std::ffi::OsStr;
use std::fmt;
use std::path::PathBuf;
use std::str::FromStr;
use rustc_data_structures::fx::FxHashMap;
-use rustc_driver::print_flag_list;
use rustc_session::config::{
self, parse_crate_types_from_list, parse_externs, parse_target_triple, CrateType,
};
@@ -31,18 +29,13 @@ use crate::passes::{self, Condition};
use crate::scrape_examples::{AllCallLocations, ScrapeExamplesOptions};
use crate::theme;
-#[derive(Clone, Copy, PartialEq, Eq, Debug)]
+#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
pub(crate) enum OutputFormat {
Json,
+ #[default]
Html,
}
-impl Default for OutputFormat {
- fn default() -> OutputFormat {
- OutputFormat::Html
- }
-}
-
impl OutputFormat {
pub(crate) fn is_json(&self) -> bool {
matches!(self, OutputFormat::Json)
@@ -235,7 +228,7 @@ pub(crate) struct RenderOptions {
pub(crate) extension_css: Option<PathBuf>,
/// A map of crate names to the URL to use instead of querying the crate's `html_root_url`.
pub(crate) extern_html_root_urls: BTreeMap<String, String>,
- /// Whether to give precedence to `html_root_url` or `--exten-html-root-url`.
+ /// Whether to give precedence to `html_root_url` or `--extern-html-root-url`.
pub(crate) extern_html_root_takes_precedence: bool,
/// A map of the default settings (values are as for DOM storage API). Keys should lack the
/// `rustdoc-` prefix.
@@ -333,14 +326,7 @@ impl Options {
return Err(0);
}
- let z_flags = matches.opt_strs("Z");
- if z_flags.iter().any(|x| *x == "help") {
- print_flag_list("-Z", config::Z_OPTIONS);
- return Err(0);
- }
- let c_flags = matches.opt_strs("C");
- if c_flags.iter().any(|x| *x == "help") {
- print_flag_list("-C", config::CG_OPTIONS);
+ if rustc_driver::describe_flag_categories(&matches) {
return Err(0);
}