diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-12-31 20:15:40 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2020-01-01 09:15:18 +0300 |
| commit | 70f1d57048d2c73c8c018d0d65ceb0e2ca5d9dae (patch) | |
| tree | ed077cbfc27cfa99565965681f03138285b1cb00 /src/librustc_errors | |
| parent | 38aa6bdfd705ea0604d7d5dd9fabc5e8f853a4fc (diff) | |
| download | rust-70f1d57048d2c73c8c018d0d65ceb0e2ca5d9dae.tar.gz rust-70f1d57048d2c73c8c018d0d65ceb0e2ca5d9dae.zip | |
Rename `syntax_pos` to `rustc_span` in source code
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/librustc_errors/annotate_snippet_emitter_writer.rs | 4 | ||||
| -rw-r--r-- | src/librustc_errors/diagnostic.rs | 2 | ||||
| -rw-r--r-- | src/librustc_errors/diagnostic_builder.rs | 2 | ||||
| -rw-r--r-- | src/librustc_errors/emitter.rs | 4 | ||||
| -rw-r--r-- | src/librustc_errors/json.rs | 6 | ||||
| -rw-r--r-- | src/librustc_errors/json/tests.rs | 8 | ||||
| -rw-r--r-- | src/librustc_errors/lib.rs | 8 |
8 files changed, 18 insertions, 18 deletions
diff --git a/src/librustc_errors/Cargo.toml b/src/librustc_errors/Cargo.toml index 8a21150570a..0d0989677c5 100644 --- a/src/librustc_errors/Cargo.toml +++ b/src/librustc_errors/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] log = "0.4" rustc_serialize = { path = "../libserialize", package = "serialize" } -syntax_pos = { path = "../librustc_span", package = "rustc_span" } +rustc_span = { path = "../librustc_span" } rustc_data_structures = { path = "../librustc_data_structures" } unicode-width = "0.1.4" atty = "0.2" diff --git a/src/librustc_errors/annotate_snippet_emitter_writer.rs b/src/librustc_errors/annotate_snippet_emitter_writer.rs index e63e124fbc5..7413cef6d32 100644 --- a/src/librustc_errors/annotate_snippet_emitter_writer.rs +++ b/src/librustc_errors/annotate_snippet_emitter_writer.rs @@ -12,8 +12,8 @@ use annotate_snippets::display_list::DisplayList; use annotate_snippets::formatter::DisplayListFormatter; use annotate_snippets::snippet::*; use rustc_data_structures::sync::Lrc; -use syntax_pos::source_map::SourceMap; -use syntax_pos::{Loc, MultiSpan, SourceFile}; +use rustc_span::source_map::SourceMap; +use rustc_span::{Loc, MultiSpan, SourceFile}; /// Generates diagnostics using annotate-snippet pub struct AnnotateSnippetEmitterWriter { diff --git a/src/librustc_errors/diagnostic.rs b/src/librustc_errors/diagnostic.rs index 6112269ef7f..5286e8c19b4 100644 --- a/src/librustc_errors/diagnostic.rs +++ b/src/librustc_errors/diagnostic.rs @@ -5,8 +5,8 @@ use crate::Level; use crate::Substitution; use crate::SubstitutionPart; use crate::SuggestionStyle; +use rustc_span::{MultiSpan, Span, DUMMY_SP}; use std::fmt; -use syntax_pos::{MultiSpan, Span, DUMMY_SP}; #[must_use] #[derive(Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)] diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs index ef3a4a9a708..79ec9ad7b03 100644 --- a/src/librustc_errors/diagnostic_builder.rs +++ b/src/librustc_errors/diagnostic_builder.rs @@ -2,10 +2,10 @@ use crate::{Applicability, Handler, Level, StashKey}; use crate::{Diagnostic, DiagnosticId, DiagnosticStyledString}; use log::debug; +use rustc_span::{MultiSpan, Span}; use std::fmt::{self, Debug}; use std::ops::{Deref, DerefMut}; use std::thread::panicking; -use syntax_pos::{MultiSpan, Span}; /// Used for emitting structured error messages and other diagnostic information. /// diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index fdac4390b26..541b89e6fce 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -9,8 +9,8 @@ use Destination::*; -use syntax_pos::source_map::SourceMap; -use syntax_pos::{MultiSpan, SourceFile, Span}; +use rustc_span::source_map::SourceMap; +use rustc_span::{MultiSpan, SourceFile, Span}; use crate::snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, Style, StyledString}; use crate::styled_buffer::StyledBuffer; diff --git a/src/librustc_errors/json.rs b/src/librustc_errors/json.rs index 5f529c08c78..29d3122636e 100644 --- a/src/librustc_errors/json.rs +++ b/src/librustc_errors/json.rs @@ -9,7 +9,7 @@ // FIXME: spec the JSON output properly. -use syntax_pos::source_map::{FilePathMapping, SourceMap}; +use rustc_span::source_map::{FilePathMapping, SourceMap}; use crate::emitter::{Emitter, HumanReadableErrorType}; use crate::registry::Registry; @@ -17,11 +17,11 @@ use crate::{Applicability, DiagnosticId}; use crate::{CodeSuggestion, SubDiagnostic}; use rustc_data_structures::sync::Lrc; +use rustc_span::{MacroBacktrace, MultiSpan, Span, SpanLabel}; use std::io::{self, Write}; use std::path::Path; use std::sync::{Arc, Mutex}; use std::vec; -use syntax_pos::{MacroBacktrace, MultiSpan, Span, SpanLabel}; use rustc_serialize::json::{as_json, as_pretty_json}; @@ -378,7 +378,7 @@ impl DiagnosticSpan { impl DiagnosticSpanLine { fn line_from_source_file( - fm: &syntax_pos::SourceFile, + fm: &rustc_span::SourceFile, index: usize, h_start: usize, h_end: usize, diff --git a/src/librustc_errors/json/tests.rs b/src/librustc_errors/json/tests.rs index a96bf715858..35912901d68 100644 --- a/src/librustc_errors/json/tests.rs +++ b/src/librustc_errors/json/tests.rs @@ -1,12 +1,12 @@ use super::*; use crate::json::JsonEmitter; -use syntax_pos::source_map::{FilePathMapping, SourceMap}; +use rustc_span::source_map::{FilePathMapping, SourceMap}; use crate::emitter::{ColorConfig, HumanReadableErrorType}; use crate::Handler; use rustc_serialize::json::decode; -use syntax_pos::{BytePos, Span}; +use rustc_span::{BytePos, Span}; use std::str; @@ -40,8 +40,8 @@ impl<T: Write> Write for Shared<T> { } fn with_default_globals(f: impl FnOnce()) { - let globals = syntax_pos::Globals::new(syntax_pos::edition::DEFAULT_EDITION); - syntax_pos::GLOBALS.set(&globals, || syntax_pos::GLOBALS.set(&globals, f)) + let globals = rustc_span::Globals::new(rustc_span::edition::DEFAULT_EDITION); + rustc_span::GLOBALS.set(&globals, || rustc_span::GLOBALS.set(&globals, f)) } /// Test the span yields correct positions in JSON. diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 53a673714a9..aa2865a75f9 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -18,8 +18,8 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_data_structures::stable_hasher::StableHasher; use rustc_data_structures::sync::{self, Lock, Lrc}; use rustc_data_structures::AtomicRef; -use syntax_pos::source_map::SourceMap; -use syntax_pos::{Loc, MultiSpan, Span}; +use rustc_span::source_map::SourceMap; +use rustc_span::{Loc, MultiSpan, Span}; use std::borrow::Cow; use std::panic; @@ -146,7 +146,7 @@ impl CodeSuggestion { /// Returns the assembled code suggestions, whether they should be shown with an underline /// and whether the substitution only differs in capitalization. pub fn splice_lines(&self, cm: &SourceMap) -> Vec<(String, Vec<SubstitutionPart>, bool)> { - use syntax_pos::{CharPos, Pos}; + use rustc_span::{CharPos, Pos}; fn push_trailing( buf: &mut String, @@ -240,7 +240,7 @@ impl CodeSuggestion { } } -pub use syntax_pos::fatal_error::{FatalError, FatalErrorMarker}; +pub use rustc_span::fatal_error::{FatalError, FatalErrorMarker}; /// Signifies that the compiler died with an explicit call to `.bug` /// or `.span_bug` rather than a failed assertion, etc. |
