diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-27 22:08:48 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-03-27 22:11:58 -0700 |
| commit | edb747ceedcfec2eb9f698b0e11b7e94d9174f33 (patch) | |
| tree | 4b534b40c5a3a06a14e929c680c2ca9c28d1898e /src/rustc/syntax/parse/parser.rs | |
| parent | c9102ee7a1e9c01e9befca44a0c0cb474fff89b4 (diff) | |
| download | rust-edb747ceedcfec2eb9f698b0e11b7e94d9174f33.tar.gz rust-edb747ceedcfec2eb9f698b0e11b7e94d9174f33.zip | |
Enforce mutability declarations in classes; correct shapes for classes
1. Enforce mutability declarations on class fields. Don't allow any mutation of class fields not declared as mutable (except inside the constructor). 2. Handle classes correctly in shape (treat classes like records).
Diffstat (limited to 'src/rustc/syntax/parse/parser.rs')
| -rw-r--r-- | src/rustc/syntax/parse/parser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rustc/syntax/parse/parser.rs b/src/rustc/syntax/parse/parser.rs index a898ee840be..3ca2e6a588b 100644 --- a/src/rustc/syntax/parse/parser.rs +++ b/src/rustc/syntax/parse/parser.rs @@ -1684,8 +1684,8 @@ fn parse_let(p: parser) -> @ast::decl { fn parse_instance_var(p:parser) -> (ast::class_member, codemap::span) { let mut is_mutbl = ast::class_immutable; let lo = p.span.lo; - if eat_word(p, "mut") { - is_mutbl = ast::class_mutable; + if eat_word(p, "mut") || eat_word(p, "mutable") { + is_mutbl = ast::class_mutable; } if !is_plain_ident(p) { p.fatal("expecting ident"); |
