let config = interface::Config {
opts: sessopts,
crate_cfg: interface::parse_cfgspecs(cfgs),
+ crate_check_cfg: interface::parse_check_cfg(options.check_cfgs.clone()),
input,
input_path: None,
output_file: None,
for cfg in &rustdoc_options.cfgs {
compiler.arg("--cfg").arg(&cfg);
}
+ if !rustdoc_options.check_cfgs.is_empty() {
+ compiler.arg("-Z").arg("unstable-options");
+ for check_cfg in &rustdoc_options.check_cfgs {
+ compiler.arg("--check-cfg").arg(&check_cfg);
+ }
+ }
if let Some(sysroot) = rustdoc_options.maybe_sysroot {
compiler.arg("--sysroot").arg(sysroot);
}
let mut parser = match maybe_new_parser_from_source_str(&sess, filename, source) {
Ok(p) => p,
Err(errs) => {
- for mut err in errs {
- err.cancel();
- }
-
+ drop(errs);
return (found_main, found_extern_crate, found_macro);
}
};
}
}
Ok(None) => break,
- Err(mut e) => {
+ Err(e) => {
e.cancel();
break;
}
Ignore::None => false,
Ignore::Some(ref ignores) => ignores.iter().any(|s| target_str.contains(s)),
},
+ #[cfg(not(bootstrap))]
+ ignore_message: None,
// compiler failures are test failures
should_panic: test::ShouldPanic::No,
compile_fail: config.compile_fail,
no_run,
test_type: test::TestType::DocTest,
- #[cfg(bootstrap)]
- allow_fail: false,
},
testfn: test::DynTestFn(box move || {
let report_unused_externs = |uext| {
fn visit_item(&mut self, item: &'hir hir::Item<'_>) {
let name = match &item.kind {
- hir::ItemKind::Macro(ref macro_def) => {
+ hir::ItemKind::Macro(ref macro_def, _) => {
// FIXME(#88038): Non exported macros have historically not been tested,
// but we really ought to start testing them.
let def_id = item.def_id.to_def_id();