diff options
| author | Inokentiy Babushkin <twk@twki.de> | 2017-06-12 15:37:26 +0200 |
|---|---|---|
| committer | Inokentiy Babushkin <twk@twki.de> | 2017-06-12 15:37:26 +0200 |
| commit | 271133b03ee5da57334670f50cd8a6ebbc35d140 (patch) | |
| tree | 4401cf452b68d5962427a0e1fb4057a590231e27 /src/libsyntax | |
| parent | afe841587df0d20b344b576641d0a32d32b87f54 (diff) | |
| download | rust-271133b03ee5da57334670f50cd8a6ebbc35d140.tar.gz rust-271133b03ee5da57334670f50cd8a6ebbc35d140.zip | |
External spans: address review.
* The lazy loading mechanism has been moved to a more appropriate place. * Return values from the functions invoked there are properly used. * Documentation has gotten some minor improvements. * Possibly some larger restructuring will need to take place still.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/codemap.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 7267f510a49..5b10139cd19 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -559,19 +559,9 @@ impl CodeMapper for CodeMap { } sp } - fn load_source_for_filemap(&self, filename: FileName) -> bool { - let file_map = if let Some(fm) = self.get_filemap(&filename) { - fm - } else { - return false; - }; - - if *file_map.external_src.borrow() == ExternalSource::AbsentOk { - let src = self.file_loader.read_file(Path::new(&filename)).ok(); - return file_map.add_external_src(src); - } - - false + fn ensure_filemap_source_present(&self, file_map: Rc<FileMap>) -> bool { + let src = self.file_loader.read_file(Path::new(&file_map.name)).ok(); + return file_map.add_external_src(src) } } |
