use crate::html::render::StylePath;
use crate::html::static_files;
use crate::opts;
-use crate::passes::{self, Condition, DefaultPassOption};
+use crate::passes::{self, Condition};
use crate::scrape_examples::{AllCallLocations, ScrapeExamplesOptions};
use crate::theme;
crate test_builder: Option<PathBuf>,
// Options that affect the documentation process
- /// The selected default set of passes to use.
- ///
- /// Be aware: This option can come both from the CLI and from crate attributes!
- crate default_passes: DefaultPassOption,
- /// Any passes manually selected by the user.
- ///
- /// Be aware: This option can come both from the CLI and from crate attributes!
- crate manual_passes: Vec<String>,
/// Whether to run the `calculate-doc-coverage` pass, which counts the number of public items
/// with and without documentation.
crate show_coverage: bool,
.field("test_args", &self.test_args)
.field("test_run_directory", &self.test_run_directory)
.field("persist_doctests", &self.persist_doctests)
- .field("default_passes", &self.default_passes)
- .field("manual_passes", &self.manual_passes)
.field("show_coverage", &self.show_coverage)
.field("crate_version", &self.crate_version)
.field("render_options", &self.render_options)
crate emit: Vec<EmitType>,
/// If `true`, HTML source pages will generate links for items to their definition.
crate generate_link_to_definition: bool,
+ /// Set of function-call locations to include as examples
crate call_locations: AllCallLocations,
+ /// If `true`, Context::init will not emit shared files.
+ crate no_emit_shared: bool,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
return Err(0);
}
+ let color = config::parse_color(matches);
+ let config::JsonConfig { json_rendered, json_unused_externs, .. } =
+ config::parse_json(matches);
+ let error_format = config::parse_error_format(matches, color, json_rendered);
+
+ let codegen_options = CodegenOptions::build(matches, error_format);
+ let debugging_opts = DebuggingOptions::build(matches, error_format);
+
+ let diag = new_handler(error_format, None, &debugging_opts);
+
+ // check for deprecated options
+ check_deprecated_options(matches, &diag);
+
if matches.opt_strs("passes") == ["list"] {
println!("Available passes for running rustdoc:");
for pass in passes::PASSES {
return Err(0);
}
- let color = config::parse_color(matches);
- let config::JsonConfig { json_rendered, json_unused_externs, .. } =
- config::parse_json(matches);
- let error_format = config::parse_error_format(matches, color, json_rendered);
-
- let codegen_options = CodegenOptions::build(matches, error_format);
- let debugging_opts = DebuggingOptions::build(matches, error_format);
-
- let diag = new_handler(error_format, None, &debugging_opts);
-
- // check for deprecated options
- check_deprecated_options(matches, &diag);
-
let mut emit = Vec::new();
for list in matches.opt_strs("emit") {
for kind in list.split(',') {
let show_coverage = matches.opt_present("show-coverage");
- let default_passes = if matches.opt_present("no-defaults") {
- passes::DefaultPassOption::None
- } else if show_coverage {
- passes::DefaultPassOption::Coverage
- } else {
- passes::DefaultPassOption::Default
- };
- let manual_passes = matches.opt_strs("passes");
-
let crate_types = match parse_crate_types_from_list(matches.opt_strs("crate-type")) {
Ok(types) => types,
Err(e) => {
lint_cap,
should_test,
test_args,
- default_passes,
- manual_passes,
show_coverage,
crate_version,
test_run_directory,
emit,
generate_link_to_definition,
call_locations,
+ no_emit_shared: false,
},
crate_name,
output_format,
/// Prints deprecation warnings for deprecated options
fn check_deprecated_options(matches: &getopts::Matches, diag: &rustc_errors::Handler) {
- let deprecated_flags = ["input-format", "no-defaults", "passes"];
+ let deprecated_flags = [];
- for flag in deprecated_flags.iter() {
+ for &flag in deprecated_flags.iter() {
if matches.opt_present(flag) {
- let mut err = diag.struct_warn(&format!("the `{}` flag is deprecated", flag));
+ diag.struct_warn(&format!("the `{}` flag is deprecated", flag))
+ .note(
+ "see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
+ for more information",
+ )
+ .emit();
+ }
+ }
+
+ let removed_flags = ["plugins", "plugin-path", "no-defaults", "passes", "input-format"];
+
+ for &flag in removed_flags.iter() {
+ if matches.opt_present(flag) {
+ let mut err = diag.struct_warn(&format!("the `{}` flag no longer functions", flag));
err.note(
"see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
- for more information",
+ for more information",
);
- if *flag == "no-defaults" {
+ if flag == "no-defaults" || flag == "passes" {
err.help("you may want to use --document-private-items");
+ } else if flag == "plugins" || flag == "plugin-path" {
+ err.warn("see CVE-2018-1000622");
}
err.emit();
}
}
-
- let removed_flags = ["plugins", "plugin-path"];
-
- for &flag in removed_flags.iter() {
- if matches.opt_present(flag) {
- diag.struct_warn(&format!("the '{}' flag no longer functions", flag))
- .warn("see CVE-2018-1000622")
- .emit();
- }
- }
}
/// Extracts `--extern-html-root-url` arguments from `matches` and returns a map of crate names to