Skip to content

Commit aaffc99

Browse files
committed
---
yaml --- r: 97397 b: refs/heads/dist-snap c: 39f39ed h: refs/heads/master i: 97395: 7089f83 v: v3
1 parent 1f3d319 commit aaffc99

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 27cc3d203baf219ae06596e9ac44f0c394024bb5
9+
refs/heads/dist-snap: 39f39ed40bc7c8a2c01a61584fb88a723b3e62ca
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libsyntax/codemap.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub struct FileMap {
223223
/// Locations of lines beginnings in the source code
224224
lines: RefCell<~[BytePos]>,
225225
/// Locations of multi-byte characters in the source code
226-
multibyte_chars: @mut ~[MultiByteChar],
226+
multibyte_chars: RefCell<~[MultiByteChar]>,
227227
}
228228

229229
impl FileMap {
@@ -258,7 +258,8 @@ impl FileMap {
258258
pos: pos,
259259
bytes: bytes,
260260
};
261-
self.multibyte_chars.push(mbc);
261+
let mut multibyte_chars = self.multibyte_chars.borrow_mut();
262+
multibyte_chars.get().push(mbc);
262263
}
263264

264265
pub fn is_real_file(&self) -> bool {
@@ -300,7 +301,7 @@ impl CodeMap {
300301
name: filename, substr: substr, src: src,
301302
start_pos: Pos::from_uint(start_pos),
302303
lines: RefCell::new(~[]),
303-
multibyte_chars: @mut ~[],
304+
multibyte_chars: RefCell::new(~[]),
304305
};
305306

306307
files.push(filemap);
@@ -471,7 +472,8 @@ impl CodeMap {
471472
// The number of extra bytes due to multibyte chars in the FileMap
472473
let mut total_extra_bytes = 0;
473474

474-
for mbc in map.multibyte_chars.iter() {
475+
let multibyte_chars = map.multibyte_chars.borrow();
476+
for mbc in multibyte_chars.get().iter() {
475477
debug!("codemap: {:?}-byte char at {:?}", mbc.bytes, mbc.pos);
476478
if mbc.pos < bpos {
477479
total_extra_bytes += mbc.bytes;

branches/dist-snap/src/libsyntax/ext/source_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn expand_include_str(cx: &mut ExtCtxt, sp: Span, tts: &[ast::token_tree])
115115
src: s,
116116
start_pos: codemap::BytePos(0),
117117
lines: RefCell::new(~[]),
118-
multibyte_chars: @mut ~[],
118+
multibyte_chars: RefCell::new(~[]),
119119
});
120120
base::MRExpr(cx.expr_str(sp, s))
121121
}

0 commit comments

Comments
 (0)