diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-06-11 19:13:42 -0700 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2013-06-28 10:44:16 -0400 |
| commit | a1531ed946e2d650fc6cb5af6258fed8003e9443 (patch) | |
| tree | 8f629d34e6cb62bd9a5a2ef22656075715446c0e /src/libsyntax/parse/lexer.rs | |
| parent | 3fcd4dca301d01c41a7db7f9023bc11be1025fc7 (diff) | |
| download | rust-a1531ed946e2d650fc6cb5af6258fed8003e9443.tar.gz rust-a1531ed946e2d650fc6cb5af6258fed8003e9443.zip | |
librustc: Remove the broken overloaded assign-ops from the language.
They evaluated the receiver twice. They should be added back with `AddAssign`, `SubAssign`, etc., traits.
Diffstat (limited to 'src/libsyntax/parse/lexer.rs')
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index 2092f0fa5fa..4a872832952 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -180,7 +180,7 @@ pub fn bump(rdr: &mut StringReader) { let byte_offset_diff = next.next - current_byte_offset; rdr.pos = rdr.pos + BytePos(byte_offset_diff); rdr.curr = next.ch; - rdr.col += CharPos(1u); + rdr.col = rdr.col + CharPos(1u); if last_char == '\n' { rdr.filemap.next_line(rdr.last_pos); rdr.col = CharPos(0u); @@ -448,8 +448,8 @@ fn scan_number(c: char, rdr: @mut StringReader) -> token::Token { is_float = true; bump(rdr); let dec_part = scan_digits(rdr, 10u); - num_str += "."; - num_str += dec_part; + num_str.push_char('.'); + num_str.push_str(dec_part); } if is_float { match base { @@ -461,7 +461,7 @@ fn scan_number(c: char, rdr: @mut StringReader) -> token::Token { match scan_exponent(rdr) { Some(ref s) => { is_float = true; - num_str += (*s); + num_str.push_str(*s); } None => () } |
