pub(crate) input: PathBuf,
/// The name of the crate being documented.
pub(crate) crate_name: Option<String>,
- /// The types of the crate being documented.
- pub(crate) crate_types: Vec<CrateType>,
+ /// Whether or not this is a bin crate
+ pub(crate) bin_crate: bool,
+ /// Whether or not this is a proc-macro crate
+ pub(crate) proc_macro_crate: bool,
/// How to format errors and warnings.
pub(crate) error_format: ErrorOutputType,
/// Width of output buffer to truncate errors appropriately.
f.debug_struct("Options")
.field("input", &self.input)
.field("crate_name", &self.crate_name)
- .field("crate_types", &self.crate_types)
+ .field("bin_crate", &self.bin_crate)
+ .field("proc_macro_crate", &self.proc_macro_crate)
.field("error_format", &self.error_format)
.field("libs", &self.libs)
.field("externs", &FmtExterns(&self.externs))
None => OutputFormat::default(),
};
let crate_name = matches.opt_str("crate-name");
+ let bin_crate = crate_types.contains(&CrateType::Executable);
+ let proc_macro_crate = crate_types.contains(&CrateType::ProcMacro);
let playground_url = matches.opt_str("playground-url");
let maybe_sysroot = matches.opt_str("sysroot").map(PathBuf::from);
let module_sorting = if matches.opt_present("sort-modules-by-appearance") {
rustc_feature::UnstableFeatures::from_environment(crate_name.as_deref());
let options = Options {
input,
- crate_types,
+ bin_crate,
+ proc_macro_crate,
error_format,
diagnostic_width,
libs,