diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-15 08:32:31 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-15 08:45:43 -0500 |
| commit | 3f93ffc3334b77cc9025f68dfcea92098987abf3 (patch) | |
| tree | 8e532f41f4ddb5f1203d29c4b17114f70694ad3a /src/librustc_errors/annotate_snippet_emitter_writer.rs | |
| parent | 942f0a6f7a82facc30501232e28759cab54a21b3 (diff) | |
| download | rust-3f93ffc3334b77cc9025f68dfcea92098987abf3.tar.gz rust-3f93ffc3334b77cc9025f68dfcea92098987abf3.zip | |
Remove SourceMapper trait
SourceMap is now in the root of all rustc-specific crates, syntax_pos, so there's no need for the trait object to decouple the dependencies between librustc_errors and libsyntax as was needed previously.
Diffstat (limited to 'src/librustc_errors/annotate_snippet_emitter_writer.rs')
| -rw-r--r-- | src/librustc_errors/annotate_snippet_emitter_writer.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/librustc_errors/annotate_snippet_emitter_writer.rs b/src/librustc_errors/annotate_snippet_emitter_writer.rs index 491bc2aa6a2..4c5d0178b2c 100644 --- a/src/librustc_errors/annotate_snippet_emitter_writer.rs +++ b/src/librustc_errors/annotate_snippet_emitter_writer.rs @@ -6,9 +6,10 @@ //! [annotate_snippets]: https://docs.rs/crate/annotate-snippets/ use syntax_pos::{SourceFile, MultiSpan, Loc}; +use syntax_pos::source_map::SourceMap; use crate::{ Level, CodeSuggestion, Diagnostic, Emitter, - SourceMapperDyn, SubDiagnostic, DiagnosticId + SubDiagnostic, DiagnosticId }; use crate::emitter::FileWithAnnotatedLines; use rustc_data_structures::sync::Lrc; @@ -20,7 +21,7 @@ use annotate_snippets::formatter::DisplayListFormatter; /// Generates diagnostics using annotate-snippet pub struct AnnotateSnippetEmitterWriter { - source_map: Option<Lrc<SourceMapperDyn>>, + source_map: Option<Lrc<SourceMap>>, /// If true, hides the longer explanation text short_message: bool, /// If true, will normalize line numbers with `LL` to prevent noise in UI test diffs. @@ -49,7 +50,7 @@ impl Emitter for AnnotateSnippetEmitterWriter { &suggestions); } - fn source_map(&self) -> Option<&Lrc<SourceMapperDyn>> { + fn source_map(&self) -> Option<&Lrc<SourceMap>> { self.source_map.as_ref() } @@ -61,7 +62,7 @@ impl Emitter for AnnotateSnippetEmitterWriter { /// Collects all the data needed to generate the data structures needed for the /// `annotate-snippets` library. struct DiagnosticConverter<'a> { - source_map: Option<Lrc<SourceMapperDyn>>, + source_map: Option<Lrc<SourceMap>>, level: Level, message: String, code: Option<DiagnosticId>, @@ -168,7 +169,7 @@ impl<'a> DiagnosticConverter<'a> { impl AnnotateSnippetEmitterWriter { pub fn new( - source_map: Option<Lrc<SourceMapperDyn>>, + source_map: Option<Lrc<SourceMap>>, short_message: bool, external_macro_backtrace: bool, ) -> Self { |
