pub(crate) input: PathBuf,
/// The name of the crate being documented.
pub(crate) crate_name: Option<String>,
+ /// 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.
f.debug_struct("Options")
.field("input", &self.input)
.field("crate_name", &self.crate_name)
+ .field("bin_crate", &self.bin_crate)
.field("proc_macro_crate", &self.proc_macro_crate)
.field("error_format", &self.error_format)
.field("libs", &self.libs)
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);
rustc_feature::UnstableFeatures::from_environment(crate_name.as_deref());
let options = Options {
input,
+ bin_crate,
proc_macro_crate,
error_format,
diagnostic_width,