diff options
| author | Donato Sciarra <sciarp@gmail.com> | 2018-08-18 12:13:35 +0200 |
|---|---|---|
| committer | Donato Sciarra <sciarp@gmail.com> | 2018-08-19 23:00:59 +0200 |
| commit | c65547337831babea8d9052b960649309263df36 (patch) | |
| tree | e33b9c8d595cc8d8cf59b844daadfc390c24b368 /src/librustc_errors | |
| parent | 3ac79c718475fd29b8be34dde667b683390c2aee (diff) | |
| download | rust-c65547337831babea8d9052b960649309263df36.tar.gz rust-c65547337831babea8d9052b960649309263df36.zip | |
mv CodeMap SourceMap
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/emitter.rs | 8 | ||||
| -rw-r--r-- | src/librustc_errors/lib.rs | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 6b1298750fb..0a3e4d3ad25 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -12,7 +12,7 @@ use self::Destination::*; use syntax_pos::{FileMap, Span, MultiSpan}; -use {Level, CodeSuggestion, DiagnosticBuilder, SubDiagnostic, CodeMapperDyn, DiagnosticId}; +use {Level, CodeSuggestion, DiagnosticBuilder, SubDiagnostic, SourceMapperDyn, DiagnosticId}; use snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, StyledString, Style}; use styled_buffer::StyledBuffer; @@ -120,7 +120,7 @@ impl ColorConfig { pub struct EmitterWriter { dst: Destination, - cm: Option<Lrc<CodeMapperDyn>>, + cm: Option<Lrc<SourceMapperDyn>>, short_message: bool, teach: bool, ui_testing: bool, @@ -134,7 +134,7 @@ struct FileWithAnnotatedLines { impl EmitterWriter { pub fn stderr(color_config: ColorConfig, - code_map: Option<Lrc<CodeMapperDyn>>, + code_map: Option<Lrc<SourceMapperDyn>>, short_message: bool, teach: bool) -> EmitterWriter { @@ -149,7 +149,7 @@ impl EmitterWriter { } pub fn new(dst: Box<dyn Write + Send>, - code_map: Option<Lrc<CodeMapperDyn>>, + code_map: Option<Lrc<SourceMapperDyn>>, short_message: bool, teach: bool) -> EmitterWriter { diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 1666369e422..40d7a122d30 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -111,9 +111,9 @@ pub struct SubstitutionPart { pub snippet: String, } -pub type CodeMapperDyn = dyn CodeMapper + sync::Send + sync::Sync; +pub type SourceMapperDyn = dyn SourceMapper + sync::Send + sync::Sync; -pub trait CodeMapper { +pub trait SourceMapper { fn lookup_char_pos(&self, pos: BytePos) -> Loc; fn span_to_lines(&self, sp: Span) -> FileLinesResult; fn span_to_string(&self, sp: Span) -> String; @@ -126,7 +126,7 @@ pub trait CodeMapper { impl CodeSuggestion { /// Returns the assembled code suggestions and whether they should be shown with an underline. - pub fn splice_lines(&self, cm: &CodeMapperDyn) + pub fn splice_lines(&self, cm: &SourceMapperDyn) -> Vec<(String, Vec<SubstitutionPart>)> { use syntax_pos::{CharPos, Loc, Pos}; @@ -321,7 +321,7 @@ impl Handler { pub fn with_tty_emitter(color_config: ColorConfig, can_emit_warnings: bool, treat_err_as_bug: bool, - cm: Option<Lrc<CodeMapperDyn>>) + cm: Option<Lrc<SourceMapperDyn>>) -> Handler { Handler::with_tty_emitter_and_flags( color_config, @@ -334,7 +334,7 @@ impl Handler { } pub fn with_tty_emitter_and_flags(color_config: ColorConfig, - cm: Option<Lrc<CodeMapperDyn>>, + cm: Option<Lrc<SourceMapperDyn>>, flags: HandlerFlags) -> Handler { let emitter = Box::new(EmitterWriter::stderr(color_config, cm, false, false)); |
