Rollup merge of #66068 - euclio:null-emitter, r=estebank
use silent emitter for rustdoc highlighting pass Partially addresses #63284.
This commit is contained in:
commit
f5c54896b9
5 changed files with 19 additions and 79 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue