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.
This commit is contained in:
Mark Rousskov 2019-11-15 08:27:09 -05:00
parent e1a87ca17a
commit 942f0a6f7a
6 changed files with 8 additions and 4 deletions

View File

@ -4445,6 +4445,7 @@ version = "0.0.0"
dependencies = [
"arena",
"cfg-if",
"log",
"rustc_data_structures",
"rustc_index",
"rustc_macros",

View File

@ -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;

View File

@ -18,3 +18,4 @@ arena = { path = "../libarena" }
scoped-tls = "1.0"
unicode-width = "0.1.4"
cfg-if = "0.1.2"
log = "0.4"

View File

@ -16,6 +16,8 @@
use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
pub mod source_map;
pub mod edition;
use edition::Edition;
pub mod hygiene;

View File

@ -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()
})
}