Skip to content

Commit 9b0094e

Browse files
committed
libsyntax: Remove all mutable fields from libsyntax. rs=demuting
1 parent 3ce0dc0 commit 9b0094e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/libsyntax/codemap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ pub struct FileMap {
242242
/// The start position of this source in the CodeMap
243243
start_pos: BytePos,
244244
/// Locations of lines beginnings in the source code
245-
mut lines: ~[BytePos],
245+
lines: @mut ~[BytePos],
246246
/// Locations of multi-byte characters in the source code
247247
multibyte_chars: DVec<MultiByteChar>
248248
}
@@ -312,7 +312,7 @@ pub impl CodeMap {
312312
let filemap = @FileMap {
313313
name: filename, substr: substr, src: src,
314314
start_pos: BytePos(start_pos),
315-
mut lines: ~[],
315+
lines: @mut ~[],
316316
multibyte_chars: DVec()
317317
};
318318

@@ -439,7 +439,7 @@ priv impl CodeMap {
439439
let idx = self.lookup_filemap_idx(pos);
440440
let f = self.files[idx];
441441
let mut a = 0u;
442-
let mut b = vec::len(f.lines);
442+
let mut b = f.lines.len();
443443
while b - a > 1u {
444444
let m = (a + b) / 2u;
445445
if f.lines[m] > pos { b = m; } else { a = m; }

src/libsyntax/util/interner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ use hashmap::linear::LinearMap;
1818
use dvec::DVec;
1919

2020
pub struct Interner<T> {
21-
priv mut map: LinearMap<T, uint>,
21+
priv map: @mut LinearMap<T, uint>,
2222
priv vect: DVec<T>,
2323
}
2424

2525
// when traits can extend traits, we should extend index<uint,T> to get []
2626
pub impl<T:Eq + IterBytes + Hash + Const + Copy> Interner<T> {
2727
static fn new() -> Interner<T> {
2828
Interner {
29-
map: LinearMap::new(),
29+
map: @mut LinearMap::new(),
3030
vect: DVec(),
3131
}
3232
}

0 commit comments

Comments
 (0)