about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/parser.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 05f508edfd0..4e393777d2a 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -746,10 +746,13 @@ fn parse_path_and_ty_param_substs(p: parser) -> ast::path {
 
 fn parse_mutability(p: parser) -> ast::mutability {
     if eat_word(p, "mutable") {
-        if p.peek() == token::QUES { p.bump(); ret ast::maybe_mut; }
-        ret ast::mut;
+        if p.peek() == token::QUES { p.bump(); ast::maybe_mut }
+        else { ast::mut }
+    } else if eat_word(p, "const") {
+        ast::maybe_mut
+    } else {
+        ast::imm
     }
-    ret ast::imm;
 }
 
 fn parse_field(p: parser, sep: token::token) -> ast::field {