diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2017-12-03 14:08:21 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2017-12-21 19:21:40 +0100 |
| commit | f7082dcafb35c636533ecddf1c40d8325c5a20a5 (patch) | |
| tree | 2e7dfcb253d507d6d9d6e0fb0c7e0309b9fdadcf | |
| parent | 94b712413b72db3e34066c82357040897233077f (diff) | |
| download | rust-f7082dcafb35c636533ecddf1c40d8325c5a20a5.tar.gz rust-f7082dcafb35c636533ecddf1c40d8325c5a20a5.zip | |
Refactor code so the call to codemap.files() does not deadlock
| -rw-r--r-- | src/librustc/ich/caching_codemap_view.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/librustc/ich/caching_codemap_view.rs b/src/librustc/ich/caching_codemap_view.rs index e3934590278..3caf308d652 100644 --- a/src/librustc/ich/caching_codemap_view.rs +++ b/src/librustc/ich/caching_codemap_view.rs @@ -78,11 +78,9 @@ impl<'cm> CachingCodemapView<'cm> { // If the entry doesn't point to the correct file, fix it up if pos < cache_entry.file.start_pos || pos >= cache_entry.file.end_pos { let file_valid; - let files = self.codemap.files(); - - if files.len() > 0 { + if self.codemap.files().len() > 0 { let file_index = self.codemap.lookup_filemap_idx(pos); - let file = files[file_index].clone(); + let file = self.codemap.files()[file_index].clone(); if pos >= file.start_pos && pos < file.end_pos { cache_entry.file = file; |
