rust/src/librustc_errors
bors 28cc0c5a7b Auto merge of #42593 - ibabushkin:on-demand-external-source, r=eddyb
Implement lazy loading of external crates' sources. Fixes #38875

Fixes #38875. This is a follow-up to #42507. When a (now correctly translated) span from an external crate is referenced in a error, warning or info message, we still don't have the source code being referenced.
Since stuffing the source in the serialized metadata of an rlib is extremely wasteful, the following scheme has been implemented:

* File maps now contain a source hash that gets serialized as well.
* When a span is rendered in a message, the source hash in the corresponding file map(s) is used to try and load the source from the corresponding file on disk. If the file is not found or the hashes don't match, the failed attempt is recorded (and not retried).
* The machinery fetching source lines from file maps is augmented to use the lazily loaded external source as a secondary fallback for file maps belonging to external crates.

This required a small change to the expected stderr of one UI test (it now renders a span, where previously was none).

Further work can be done based on this - some of the machinery previously used to hide external spans is possibly obsolete and the hashing code can be reused in different places as well.

r? @eddyb
2017-06-18 10:41:05 +00:00
..
Cargo.toml store typeck lints in the TypeckTables 2017-02-02 20:38:16 -05:00
diagnostic_builder.rs fix some clippy warnings in librustc_errors 2017-05-19 01:20:48 +02:00
diagnostic.rs Suggest non-ambiguous comparison after cast 2017-06-11 23:47:26 -07:00
emitter.rs Auto merge of #42593 - ibabushkin:on-demand-external-source, r=eddyb 2017-06-18 10:41:05 +00:00
lib.rs External spans: address review. 2017-06-12 15:37:26 +02:00
lock.rs run rustfmt on librustc_errors folder 2016-10-18 23:13:02 +05:30
registry.rs run rustfmt on librustc_errors folder 2016-10-18 23:13:02 +05:30
snippet.rs Reduce visual clutter of multiline start when possible 2017-04-20 17:31:20 -07:00
styled_buffer.rs run rustfmt on librustc_errors folder 2016-10-18 23:13:02 +05:30