Rollup merge of #66068 - euclio:null-emitter, r=estebank

use silent emitter for rustdoc highlighting pass

Partially addresses #63284.
This commit is contained in:
Mazdak Farrokhzad 2019-11-06 03:28:11 +01:00 committed by GitHub
commit f5c54896b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 79 deletions

View file

@ -6,7 +6,7 @@ use crate::early_buffered_lints::{BufferedEarlyLint, BufferedEarlyLintId};
use crate::source_map::{SourceMap, FilePathMapping};
use crate::feature_gate::UnstableFeatures;
use errors::{Applicability, Handler, ColorConfig, DiagnosticBuilder};
use errors::{Applicability, emitter::SilentEmitter, Handler, ColorConfig, DiagnosticBuilder};
use rustc_data_structures::fx::{FxHashSet, FxHashMap};
use rustc_data_structures::sync::{Lrc, Lock, Once};
use syntax_pos::{Symbol, Span, MultiSpan};
@ -107,6 +107,12 @@ impl ParseSess {
}
}
pub fn with_silent_emitter() -> Self {
let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let handler = Handler::with_emitter(false, None, Box::new(SilentEmitter));
ParseSess::with_span_handler(handler, cm)
}
#[inline]
pub fn source_map(&self) -> &SourceMap {
&self.source_map