rustdoc: check code block syntax in early pass

This commit is contained in:
Andy Russell
2018-12-15 16:25:50 -05:00
parent ee10d99b9a
commit 8c93798e9f
10 changed files with 474 additions and 71 deletions

View File

@@ -238,19 +238,6 @@ impl<'a> StringReader<'a> {
sr
}
pub fn new_without_err(sess: &'a ParseSess,
source_file: Lrc<syntax_pos::SourceFile>,
override_span: Option<Span>,
prepend_error_text: &str) -> Result<Self, ()> {
let mut sr = StringReader::new_raw(sess, source_file, override_span);
if sr.advance_token().is_err() {
eprintln!("{}", prepend_error_text);
sr.emit_fatal_errors();
return Err(());
}
Ok(sr)
}
pub fn new_or_buffered_errs(sess: &'a ParseSess,
source_file: Lrc<syntax_pos::SourceFile>,
override_span: Option<Span>) -> Result<Self, Vec<Diagnostic>> {