1
Fork 0

Remove dependency on error handling from find_testable_code

This commit is contained in:
Mark Rousskov 2018-07-21 17:15:25 -06:00
parent de5cebdba5
commit 03e34f8f81
3 changed files with 24 additions and 13 deletions

View file

@ -687,10 +687,12 @@ impl<'a, 'hir> HirCollector<'a, 'hir> {
// the collapse-docs pass won't combine sugared/raw doc attributes, or included files with
// anything else, this will combine them for us
if let Some(doc) = attrs.collapsed_doc_value() {
markdown::find_testable_code(&doc,
self.collector,
attrs.span.unwrap_or(DUMMY_SP),
self.sess.diagnostic());
self.collector.set_position(attrs.span.unwrap_or(DUMMY_SP));
let res = markdown::find_testable_code(&doc, self.collector);
if let Err(err) = res {
self.sess.diagnostic().span_warn(attrs.span.unwrap_or(DUMMY_SP),
&err.to_string());
}
}
nested(self);