Skip to content

Commit 942f0a6

Browse files
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.
1 parent e1a87ca commit 942f0a6

File tree

6 files changed

+8
-4
lines changed

6 files changed

+8
-4
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4445,6 +4445,7 @@ version = "0.0.0"
44454445
dependencies = [
44464446
"arena",
44474447
"cfg-if",
4448+
"log",
44484449
"rustc_data_structures",
44494450
"rustc_index",
44504451
"rustc_macros",

src/libsyntax/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub mod json;
9292
pub mod ast;
9393
pub mod attr;
9494
pub mod expand;
95-
pub mod source_map;
95+
pub use syntax_pos::source_map;
9696
pub mod entry;
9797
pub mod feature_gate;
9898
pub mod mut_visit;

src/libsyntax_pos/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ arena = { path = "../libarena" }
1818
scoped-tls = "1.0"
1919
unicode-width = "0.1.4"
2020
cfg-if = "0.1.2"
21+
log = "0.4"

src/libsyntax_pos/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
1818

19+
pub mod source_map;
20+
1921
pub mod edition;
2022
use edition::Edition;
2123
pub mod hygiene;

src/libsyntax/source_map.rs renamed to src/libsyntax_pos/source_map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//! within the `SourceMap`, which upon request can be converted to line and column
88
//! information, source code snippets, etc.
99
10-
pub use syntax_pos::*;
11-
pub use syntax_pos::hygiene::{ExpnKind, ExpnData};
10+
pub use crate::*;
11+
pub use crate::hygiene::{ExpnKind, ExpnData};
1212

1313
use rustc_data_structures::fx::FxHashMap;
1414
use rustc_data_structures::stable_hasher::StableHasher;
@@ -216,7 +216,7 @@ impl SourceMap {
216216
self.try_new_source_file(filename, src)
217217
.unwrap_or_else(|OffsetOverflowError| {
218218
eprintln!("fatal error: rustc does not support files larger than 4GB");
219-
errors::FatalError.raise()
219+
crate::fatal_error::FatalError.raise()
220220
})
221221
}
222222

0 commit comments

Comments
 (0)