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 similarity index 99% rename from src/libsyntax/source_map.rs rename to 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 similarity index 100% rename from src/libsyntax/source_map/tests.rs rename to src/libsyntax_pos/source_map/tests.rs