This correctly fixes issue #1362. chpos/byte_pos are now the offsets within a particular file, but rather the offsets within a virtual file with is formed by combing all of the modules within a crate. Thus, resetting them to 0 causes an overlap and hence, bogus source locations. Fix #1362 by moving chpos/byte_pos to parse_sess so that new_parser_from_source_str has access to them and hence can chose an initial value that is not already been used in the crate. Note that the trigger for bug 1361 was that syntax/ext/expand.rs calls parse_expr_from_source_str (which calls new_parser_from_source_str) using the same codemap as the current crate (and hence causing overlap with files in the crate as new_parser_from_source_str resets the chpos/byte_pos to 0). |
||
|---|---|---|
| .. | ||
| cargo | ||
| comp | ||
| compiletest | ||
| etc | ||
| fuzzer | ||
| libcore | ||
| libstd | ||
| libuv@f1859eb841 | ||
| llvm@d578b905de | ||
| rt | ||
| rustdoc | ||
| rustllvm | ||
| test | ||
| README.txt | ||
| snapshots.txt | ||
This is preliminary version of the Rust compiler.
Source layout:
comp/ The self-hosted compiler
cargo/ The package manager
libcore/ The core library (imported and linked by default)
libstd/ The standard library (slightly more peripheral code)
rustllvm/ LLVM support code
rt/ The runtime system
rt/rust_*.cpp - The majority of the runtime services
rt/isaac - The PRNG used for pseudo-random choices in the runtime
rt/bigint - The bigint library used for the 'big' type
rt/uthash - Small hashtable-and-list library for C, used in runtime
rt/libuv - The library used for async IO in the runtime
rt/{sync,util} - Small utility classes for the runtime.
test/ Testsuite
test/compile-fail - Tests that should fail to compile
test/run-fail - Tests that should compile, run and fail
test/run-pass - Tests that should compile, run and succeed
test/bench - Benchmarks and miscellanea
Please be gentle, it's a work in progress.