From a07192fadd794b1eaaec85541886e07578002b74 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 21 Feb 2013 18:27:24 -0800 Subject: [PATCH] libsyntax: Remove all mutable fields from libsyntax. rs=demuting --- src/libsyntax/codemap.rs | 6 +++--- src/libsyntax/util/interner.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 3a863fc7ac5d..1ab55fe9035b 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -242,7 +242,7 @@ pub struct FileMap { /// The start position of this source in the CodeMap start_pos: BytePos, /// Locations of lines beginnings in the source code - mut lines: ~[BytePos], + lines: @mut ~[BytePos], /// Locations of multi-byte characters in the source code multibyte_chars: DVec } @@ -312,7 +312,7 @@ pub impl CodeMap { let filemap = @FileMap { name: filename, substr: substr, src: src, start_pos: BytePos(start_pos), - mut lines: ~[], + lines: @mut ~[], multibyte_chars: DVec() }; @@ -439,7 +439,7 @@ priv impl CodeMap { let idx = self.lookup_filemap_idx(pos); let f = self.files[idx]; let mut a = 0u; - let mut b = vec::len(f.lines); + let mut b = f.lines.len(); while b - a > 1u { let m = (a + b) / 2u; if f.lines[m] > pos { b = m; } else { a = m; } diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 4b13818974c3..41500d6a409a 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -18,7 +18,7 @@ use hashmap::linear::LinearMap; use dvec::DVec; pub struct Interner { - priv mut map: LinearMap, + priv map: @mut LinearMap, priv vect: DVec, } @@ -26,7 +26,7 @@ pub struct Interner { pub impl Interner { static fn new() -> Interner { Interner { - map: LinearMap::new(), + map: @mut LinearMap::new(), vect: DVec(), } }