diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-12-30 16:26:07 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-01-03 14:01:59 -0800 |
| commit | 39f39ed40bc7c8a2c01a61584fb88a723b3e62ca (patch) | |
| tree | 0fcf5b237beda73c359b402e991d8b7319044929 /src/libsyntax/codemap.rs | |
| parent | 27cc3d203baf219ae06596e9ac44f0c394024bb5 (diff) | |
| download | rust-39f39ed40bc7c8a2c01a61584fb88a723b3e62ca.tar.gz rust-39f39ed40bc7c8a2c01a61584fb88a723b3e62ca.zip | |
libsyntax: De-`@mut` `FileMap::multibyte_chars`
Diffstat (limited to 'src/libsyntax/codemap.rs')
| -rw-r--r-- | src/libsyntax/codemap.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 80dc66405e1..67a70dae24a 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -223,7 +223,7 @@ pub struct FileMap { /// Locations of lines beginnings in the source code lines: RefCell<~[BytePos]>, /// Locations of multi-byte characters in the source code - multibyte_chars: @mut ~[MultiByteChar], + multibyte_chars: RefCell<~[MultiByteChar]>, } impl FileMap { @@ -258,7 +258,8 @@ impl FileMap { pos: pos, bytes: bytes, }; - self.multibyte_chars.push(mbc); + let mut multibyte_chars = self.multibyte_chars.borrow_mut(); + multibyte_chars.get().push(mbc); } pub fn is_real_file(&self) -> bool { @@ -300,7 +301,7 @@ impl CodeMap { name: filename, substr: substr, src: src, start_pos: Pos::from_uint(start_pos), lines: RefCell::new(~[]), - multibyte_chars: @mut ~[], + multibyte_chars: RefCell::new(~[]), }; files.push(filemap); @@ -471,7 +472,8 @@ impl CodeMap { // The number of extra bytes due to multibyte chars in the FileMap let mut total_extra_bytes = 0; - for mbc in map.multibyte_chars.iter() { + let multibyte_chars = map.multibyte_chars.borrow(); + for mbc in multibyte_chars.get().iter() { debug!("codemap: {:?}-byte char at {:?}", mbc.bytes, mbc.pos); if mbc.pos < bpos { total_extra_bytes += mbc.bytes; |
