about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/lexer.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs
index f86a3d0321d..fa82e8c67f2 100644
--- a/src/libsyntax/parse/lexer.rs
+++ b/src/libsyntax/parse/lexer.rs
@@ -133,7 +133,10 @@ impl reader for StringReader {
 }
 
 impl reader for TtReader {
-    fn is_eof(@mut self) -> bool { self.cur_tok == token::EOF }
+    fn is_eof(@mut self) -> bool {
+        let cur_tok = self.cur_tok.borrow();
+        *cur_tok.get() == token::EOF
+    }
     fn next_token(@mut self) -> TokenAndSpan {
         let r = tt_next_token(self);
         debug!("TtReader: r={:?}", r);
@@ -145,7 +148,7 @@ impl reader for TtReader {
     fn span_diag(@mut self) -> @mut SpanHandler { self.sp_diag }
     fn peek(@mut self) -> TokenAndSpan {
         TokenAndSpan {
-            tok: self.cur_tok.clone(),
+            tok: self.cur_tok.get(),
             sp: self.cur_span,
         }
     }