From c2c31b2db33e0d0b5356a0c9e032269034cdc70a Mon Sep 17 00:00:00 2001 From: Inokentiy Babushkin Date: Sat, 10 Jun 2017 21:08:32 +0200 Subject: Added external crates' sources to FileMap. They are now handled in their own member to prevent mutating access to the `src` member. This way, we can safely load external sources, while keeping the mutation of local source strings off-limits. --- src/librustc_errors/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/librustc_errors') diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 8d5e9e776ed..545a485732e 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -103,6 +103,7 @@ pub trait CodeMapper { fn span_to_filename(&self, sp: Span) -> FileName; fn merge_spans(&self, sp_lhs: Span, sp_rhs: Span) -> Option; fn call_span_if_macro(&self, sp: Span) -> Span; + fn load_source_for_filemap(&mut self, file: FileName) -> bool; } impl CodeSuggestion { -- cgit 1.4.1-3-g733a5