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());
eprint!("{}", self.0);
}
}
-
let out = str::from_utf8(&output.stderr).unwrap();
let _bomb = Bomb(&out);
match (output.status.success(), compile_fail) {
(true, false) => {}
(false, true) => {
if !error_codes.is_empty() {
- error_codes.retain(|err| !out.contains(err));
+ error_codes.retain(|err| !out.contains(&format!("error[{}]: ", err)));
if !error_codes.is_empty() {
return Err(TestFailure::MissingErrorCodes(error_codes));
// crate already is included.
let result = rustc_driver::catch_fatal_errors(|| {
with_globals(edition, || {
- use errors::emitter::EmitterWriter;
- use errors::Handler;
+ use rustc_errors::emitter::EmitterWriter;
+ use rustc_errors::Handler;
use rustc_parse::maybe_new_parser_from_source_str;
use rustc_span::source_map::FilePathMapping;
use syntax::sess::ParseSess;
debug!("creating test {}: {}", name, test);
self.tests.push(testing::TestDescAndFn {
desc: testing::TestDesc {
- name: testing::DynTestName(name.clone()),
+ name: testing::DynTestName(name),
ignore: match config.ignore {
Ignore::All => true,
Ignore::None => false,