rust/src/librustc_metadata
Mazdak Farrokhzad 1f93be1bb3
Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad
Fix the start/end byte positions in the compiler JSON output

Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output.

This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one.

The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions.

Fixes #65029
2019-10-25 13:12:45 +02:00
..
dynamic_lib
build.rs
Cargo.toml move syntax::ext to new crate syntax_expand 2019-10-16 10:59:53 +02:00
creader.rs rustc_metadata: Minimize use of Lrc in crate store 2019-10-24 20:54:16 +03:00
cstore_impl.rs rustc_metadata: Minimize use of Lrc in crate store 2019-10-24 20:54:16 +03:00
cstore.rs rustc_metadata: Minimize use of Lrc in crate store 2019-10-24 20:54:16 +03:00
decoder.rs Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad 2019-10-25 13:12:45 +02:00
dependency_format.rs rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
dynamic_lib.rs rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
encoder.rs rustc_metadata: use a table for impl_trait_ref. 2019-10-22 14:21:16 +03:00
error_codes.rs Replace diagnostic plugins with macro_rules 2019-09-05 12:35:15 -04:00
foreign_modules.rs rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
lib.rs rustc_metadata: rename index::Index to table::Table. 2019-10-15 18:23:50 +03:00
link_args.rs rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
locator.rs rustc_metadata: Move some code around 2019-10-24 20:51:33 +03:00
native_libs.rs Make use of the return value of HashSet::insert 2019-10-16 13:48:20 +09:00
schema.rs rustc_metadata: use a table for impl_trait_ref. 2019-10-22 14:21:16 +03:00
table.rs rustc_metadata: address some review comments. 2019-10-15 18:23:51 +03:00