libs,
externs,
mut cfgs,
+ check_cfgs,
codegen_options,
debugging_opts,
target,
lint_opts,
describe_lints,
lint_cap,
+ scrape_examples_options,
..
}: RustdocOptions,
) -> rustc_interface::Config {
// these are definitely not part of rustdoc, but we want to warn on them anyway.
rustc_lint::builtin::RENAMED_AND_REMOVED_LINTS.name.to_string(),
rustc_lint::builtin::UNKNOWN_LINTS.name.to_string(),
+ rustc_lint::builtin::UNEXPECTED_CFGS.name.to_string(),
];
lints_to_show.extend(crate::lint::RUSTDOC_LINTS.iter().map(|lint| lint.name.to_string()));
let crate_types =
if proc_macro_crate { vec![CrateType::ProcMacro] } else { vec![CrateType::Rlib] };
+ let test = scrape_examples_options.map(|opts| opts.scrape_tests).unwrap_or(false);
// plays with error output here!
let sessopts = config::Options {
maybe_sysroot,
edition,
describe_lints,
crate_name,
+ test,
..Options::default()
};
interface::Config {
opts: sessopts,
crate_cfg: interface::parse_cfgspecs(cfgs),
+ crate_check_cfg: interface::parse_check_cfg(check_cfgs),
input,
input_path: cpath,
output_file: None,
output_dir: None,
file_loader: None,
diagnostic_output: DiagnosticOutput::Default,
- stderr: None,
lint_caps,
parse_sess_created: None,
register_lints: Some(box crate::lint::register_lints),