diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-15 08:27:09 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-15 08:38:31 -0500 |
| commit | 942f0a6f7a82facc30501232e28759cab54a21b3 (patch) | |
| tree | 30924555b407e4b34e3d6f60382b15024e27dd79 | |
| parent | e1a87ca17a60aadae36b6785b7204610e02ee994 (diff) | |
| download | rust-942f0a6f7a82facc30501232e28759cab54a21b3.tar.gz rust-942f0a6f7a82facc30501232e28759cab54a21b3.zip | |
Move SourceMap to syntax_pos
This does not update the use sites or delete the now unnecessary SourceMapper trait, to allow git to interpret the file move as a rename rather than a new file.
| -rw-r--r-- | Cargo.lock | 1 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_pos/Cargo.toml | 1 | ||||
| -rw-r--r-- | src/libsyntax_pos/lib.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_pos/source_map.rs (renamed from src/libsyntax/source_map.rs) | 6 | ||||
| -rw-r--r-- | src/libsyntax_pos/source_map/tests.rs (renamed from src/libsyntax/source_map/tests.rs) | 0 |
6 files changed, 8 insertions, 4 deletions
diff --git a/Cargo.lock b/Cargo.lock index 781184af9a9..51bdc06eee8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4445,6 +4445,7 @@ version = "0.0.0" dependencies = [ "arena", "cfg-if", + "log", "rustc_data_structures", "rustc_index", "rustc_macros", diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 6290b2137ea..a1de0a2c9e4 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -92,7 +92,7 @@ pub mod json; pub mod ast; pub mod attr; pub mod expand; -pub mod source_map; +pub use syntax_pos::source_map; pub mod entry; pub mod feature_gate; pub mod mut_visit; diff --git a/src/libsyntax_pos/Cargo.toml b/src/libsyntax_pos/Cargo.toml index 378f7a955a3..2cac76085d2 100644 --- a/src/libsyntax_pos/Cargo.toml +++ b/src/libsyntax_pos/Cargo.toml @@ -18,3 +18,4 @@ arena = { path = "../libarena" } scoped-tls = "1.0" unicode-width = "0.1.4" cfg-if = "0.1.2" +log = "0.4" diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index 50839638bb4..b88d6dbc3f3 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -16,6 +16,8 @@ use rustc_serialize::{Encodable, Decodable, Encoder, Decoder}; +pub mod source_map; + pub mod edition; use edition::Edition; pub mod hygiene; diff --git a/src/libsyntax/source_map.rs b/src/libsyntax_pos/source_map.rs index d9f618602a4..035e61f9dea 100644 --- a/src/libsyntax/source_map.rs +++ b/src/libsyntax_pos/source_map.rs @@ -7,8 +7,8 @@ //! within the `SourceMap`, which upon request can be converted to line and column //! information, source code snippets, etc. -pub use syntax_pos::*; -pub use syntax_pos::hygiene::{ExpnKind, ExpnData}; +pub use crate::*; +pub use crate::hygiene::{ExpnKind, ExpnData}; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::stable_hasher::StableHasher; @@ -216,7 +216,7 @@ impl SourceMap { self.try_new_source_file(filename, src) .unwrap_or_else(|OffsetOverflowError| { eprintln!("fatal error: rustc does not support files larger than 4GB"); - errors::FatalError.raise() + crate::fatal_error::FatalError.raise() }) } diff --git a/src/libsyntax/source_map/tests.rs b/src/libsyntax_pos/source_map/tests.rs index 15254336bbf..15254336bbf 100644 --- a/src/libsyntax/source_map/tests.rs +++ b/src/libsyntax_pos/source_map/tests.rs |
