@@ -223,7 +223,7 @@ pub struct FileMap {
223
223
/// Locations of lines beginnings in the source code
224
224
lines : RefCell < ~[ BytePos ] > ,
225
225
/// Locations of multi-byte characters in the source code
226
- multibyte_chars : @ mut ~[ MultiByteChar ] ,
226
+ multibyte_chars : RefCell < ~[ MultiByteChar ] > ,
227
227
}
228
228
229
229
impl FileMap {
@@ -258,7 +258,8 @@ impl FileMap {
258
258
pos : pos,
259
259
bytes : bytes,
260
260
} ;
261
- self . multibyte_chars . push ( mbc) ;
261
+ let mut multibyte_chars = self . multibyte_chars . borrow_mut ( ) ;
262
+ multibyte_chars. get ( ) . push ( mbc) ;
262
263
}
263
264
264
265
pub fn is_real_file ( & self ) -> bool {
@@ -300,7 +301,7 @@ impl CodeMap {
300
301
name : filename, substr : substr, src : src,
301
302
start_pos : Pos :: from_uint ( start_pos) ,
302
303
lines : RefCell :: new ( ~[ ] ) ,
303
- multibyte_chars : @ mut ~[ ] ,
304
+ multibyte_chars : RefCell :: new ( ~[ ] ) ,
304
305
} ;
305
306
306
307
files. push ( filemap) ;
@@ -471,7 +472,8 @@ impl CodeMap {
471
472
// The number of extra bytes due to multibyte chars in the FileMap
472
473
let mut total_extra_bytes = 0 ;
473
474
474
- for mbc in map. multibyte_chars . iter ( ) {
475
+ let multibyte_chars = map. multibyte_chars . borrow ( ) ;
476
+ for mbc in multibyte_chars. get ( ) . iter ( ) {
475
477
debug ! ( "codemap: {:?}-byte char at {:?}" , mbc. bytes, mbc. pos) ;
476
478
if mbc. pos < bpos {
477
479
total_extra_bytes += mbc. bytes ;
0 commit comments