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/ich | |
| 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/ich')
| -rw-r--r-- | src/librustc/ich/hcx.rs | 4 | ||||
| -rw-r--r-- | src/librustc/ich/impls_syntax.rs | 20 | ||||
| -rw-r--r-- | src/librustc/ich/mod.rs | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/librustc/ich/hcx.rs b/src/librustc/ich/hcx.rs index 9442392ea9e..305b6058d34 100644 --- a/src/librustc/ich/hcx.rs +++ b/src/librustc/ich/hcx.rs @@ -9,10 +9,10 @@ use crate::ty::{fast_reject, TyCtxt}; use std::cmp::Ord; +use rustc_span::{BytePos, SourceFile}; use syntax::ast; use syntax::source_map::SourceMap; use syntax::symbol::Symbol; -use syntax_pos::{BytePos, SourceFile}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHashKey}; @@ -270,7 +270,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for ast::NodeId { } } -impl<'a> syntax_pos::HashStableContext for StableHashingContext<'a> { +impl<'a> rustc_span::HashStableContext for StableHashingContext<'a> { fn hash_spans(&self) -> bool { self.hash_spans } diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index e13822aed4d..90e1cac211a 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -3,8 +3,8 @@ use crate::ich::StableHashingContext; +use rustc_span::SourceFile; use syntax::ast; -use syntax_pos::SourceFile; use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX}; @@ -114,22 +114,22 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile { } } -fn stable_byte_pos(pos: ::syntax_pos::BytePos, source_file_start: ::syntax_pos::BytePos) -> u32 { +fn stable_byte_pos(pos: ::rustc_span::BytePos, source_file_start: ::rustc_span::BytePos) -> u32 { pos.0 - source_file_start.0 } fn stable_multibyte_char( - mbc: ::syntax_pos::MultiByteChar, - source_file_start: ::syntax_pos::BytePos, + mbc: ::rustc_span::MultiByteChar, + source_file_start: ::rustc_span::BytePos, ) -> (u32, u32) { - let ::syntax_pos::MultiByteChar { pos, bytes } = mbc; + let ::rustc_span::MultiByteChar { pos, bytes } = mbc; (pos.0 - source_file_start.0, bytes as u32) } fn stable_non_narrow_char( - swc: ::syntax_pos::NonNarrowChar, - source_file_start: ::syntax_pos::BytePos, + swc: ::rustc_span::NonNarrowChar, + source_file_start: ::rustc_span::BytePos, ) -> (u32, u32) { let pos = swc.pos(); let width = swc.width(); @@ -138,10 +138,10 @@ fn stable_non_narrow_char( } fn stable_normalized_pos( - np: ::syntax_pos::NormalizedPos, - source_file_start: ::syntax_pos::BytePos, + np: ::rustc_span::NormalizedPos, + source_file_start: ::rustc_span::BytePos, ) -> (u32, u32) { - let ::syntax_pos::NormalizedPos { pos, diff } = np; + let ::rustc_span::NormalizedPos { pos, diff } = np; (pos.0 - source_file_start.0, diff) } diff --git a/src/librustc/ich/mod.rs b/src/librustc/ich/mod.rs index 4ad3e9482de..f07e8f38734 100644 --- a/src/librustc/ich/mod.rs +++ b/src/librustc/ich/mod.rs @@ -4,8 +4,8 @@ pub use self::hcx::{ hash_stable_trait_impls, NodeIdHashingMode, StableHashingContext, StableHashingContextProvider, }; crate use rustc_data_structures::fingerprint::Fingerprint; +pub use rustc_span::CachingSourceMapView; use syntax::symbol::{sym, Symbol}; -pub use syntax_pos::CachingSourceMapView; mod hcx; |
