use errors::emitter::ColorConfig;
use clean::Attributes;
-use html::markdown::{self, LangString};
+use html::markdown::{self, ErrorCodes, LangString};
#[derive(Clone, Default)]
pub struct TestOptions {
maybe_sysroot: maybe_sysroot.clone().or_else(
|| Some(env::current_exe().unwrap().parent().unwrap().parent().unwrap().to_path_buf())),
search_paths: libs.clone(),
- crate_types: vec![config::CrateTypeDylib],
+ crate_types: vec![config::CrateType::Dylib],
cg: cg.clone(),
externs: externs.clone(),
unstable_features: UnstableFeatures::from_environment(),
..config::basic_debugging_options()
},
edition,
- ..config::basic_options().clone()
+ ..config::Options::default()
};
driver::spawn_thread_pool(sessopts, |sessopts| {
let codemap = Lrc::new(CodeMap::new(sessopts.file_path_mapping()));
let mut hir_collector = HirCollector {
sess: &sess,
collector: &mut collector,
- map: &map
+ map: &map,
+ codes: ErrorCodes::from(sess.opts.unstable_features.is_nightly_build()),
};
hir_collector.visit_testable("".to_string(), &krate.attrs, |this| {
intravisit::walk_crate(this, krate);
maybe_sysroot: maybe_sysroot.or_else(
|| Some(env::current_exe().unwrap().parent().unwrap().parent().unwrap().to_path_buf())),
search_paths: libs,
- crate_types: vec![config::CrateTypeExecutable],
+ crate_types: vec![config::CrateType::Executable],
output_types: outputs,
externs,
cg: config::CodegenOptions {
..config::basic_debugging_options()
},
edition,
- ..config::basic_options().clone()
+ ..config::Options::default()
};
// Shuffle around a few input and output handles here. We're going to pass
struct HirCollector<'a, 'hir: 'a> {
sess: &'a session::Session,
collector: &'a mut Collector,
- map: &'a hir::map::Map<'hir>
+ map: &'a hir::map::Map<'hir>,
+ codes: ErrorCodes,
}
impl<'a, 'hir> HirCollector<'a, 'hir> {
// anything else, this will combine them for us
if let Some(doc) = attrs.collapsed_doc_value() {
self.collector.set_position(attrs.span.unwrap_or(DUMMY_SP));
- let res = markdown::find_testable_code(&doc, self.collector);
+ let res = markdown::find_testable_code(&doc, self.collector, self.codes);
if let Err(err) = res {
self.sess.diagnostic().span_warn(attrs.span.unwrap_or(DUMMY_SP),
&err.to_string());