diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2018-05-23 15:59:42 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2018-06-27 14:00:34 +0200 |
| commit | 257d279fe47bbf3431c76f0942654c1bcf60d501 (patch) | |
| tree | b7230231778da7b5345f80ea6565c67ce9b14843 /src/librustc_metadata/decoder.rs | |
| parent | c20824323cf7ed6ad95cb8d7b780a7934927a753 (diff) | |
| download | rust-257d279fe47bbf3431c76f0942654c1bcf60d501.tar.gz rust-257d279fe47bbf3431c76f0942654c1bcf60d501.zip | |
Make FileMap::{lines, multibyte_chars, non_narrow_chars} non-mutable.
Diffstat (limited to 'src/librustc_metadata/decoder.rs')
| -rw-r--r-- | src/librustc_metadata/decoder.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 9e4f695d28f..a01e0b60864 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -1138,9 +1138,9 @@ impl<'a, 'tcx> CrateMetadata { src_hash, start_pos, end_pos, - lines, - multibyte_chars, - non_narrow_chars, + mut lines, + mut multibyte_chars, + mut non_narrow_chars, name_hash, .. } = filemap_to_import; @@ -1151,15 +1151,12 @@ impl<'a, 'tcx> CrateMetadata { // `CodeMap::new_imported_filemap()` will then translate those // coordinates to their new global frame of reference when the // offset of the FileMap is known. - let mut lines = lines.into_inner(); for pos in &mut lines { *pos = *pos - start_pos; } - let mut multibyte_chars = multibyte_chars.into_inner(); for mbc in &mut multibyte_chars { mbc.pos = mbc.pos - start_pos; } - let mut non_narrow_chars = non_narrow_chars.into_inner(); for swc in &mut non_narrow_chars { *swc = *swc - start_pos; } |
