let crate_types = if options.proc_macro_crate {
vec![config::CrateType::ProcMacro]
} else {
- vec![config::CrateType::Dylib]
+ vec![config::CrateType::Rlib]
};
let sessopts = config::Options {
intravisit::walk_crate(this, krate);
});
});
+ compiler.session().abort_if_errors();
let ret: Result<_, ErrorReported> = Ok(collector.tests);
ret
})
- })
- .expect("compiler aborted in rustdoc!");
+ });
+ let tests = match tests {
+ Ok(tests) => tests,
+ Err(ErrorReported) => return 1,
+ };
test_args.insert(0, "rustdoctest".to_string());
}
fn visit_item(&mut self, item: &'hir hir::Item) {
- let name = if let hir::ItemKind::Impl(.., ref ty, _) = item.kind {
- self.map.hir_to_pretty_string(ty.hir_id)
+ let name = if let hir::ItemKind::Impl { ref self_ty, .. } = item.kind {
+ self.map.hir_to_pretty_string(self_ty.hir_id)
} else {
item.ident.to_string()
};