Skip to content

Commit 7235f3c

Browse files
committed
syntax: Eliminate 'mutable' keyword. Closes #2254
1 parent 734494a commit 7235f3c

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

src/librustsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ fn parse_let(p: parser) -> @ast::decl {
14841484
fn parse_instance_var(p:parser, pr: ast::privacy) -> @ast::class_member {
14851485
let mut is_mutbl = ast::class_immutable;
14861486
let lo = p.span.lo;
1487-
if eat_word(p, "mut") || eat_word(p, "mutable") {
1487+
if eat_word(p, "mut") {
14881488
is_mutbl = ast::class_mutable;
14891489
}
14901490
if !is_plain_ident(p.token) {

src/librustsyntax/parse/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
260260
"class", "const", "cont", "copy", "crust", "do", "else",
261261
"enum", "export", "fail", "fn", "for", "if", "iface",
262262
"impl", "import", "let", "log", "loop", "mod",
263-
"mut", "mutable", "native", "new", "pure", "resource",
263+
"mut", "native", "new", "pure", "resource",
264264
"ret", "trait", "type", "unchecked", "unsafe", "while"];
265265
for keys.each {|word|
266266
words.insert(word, ());

src/test/auxiliary/cci_class_4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class cat {
1212
}
1313
}
1414

15-
let mutable how_hungry : int;
15+
let mut how_hungry : int;
1616
let name : str;
1717

1818
new(in_x : uint, in_y : int, in_name: str)

src/test/compile-fail/ctor-uninit-var.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// error-pattern:unsatisfied precondition
22
class cat {
33
priv {
4-
let mutable meows : uint;
4+
let mut meows : uint;
55
}
66

77
let how_hungry : int;

src/test/compile-fail/mutable-class-fields-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// error-pattern:assigning to immutable field
22
class cat {
33
priv {
4-
let mutable meows : uint;
4+
let mut meows : uint;
55
}
66

77
let how_hungry : int;

src/test/compile-fail/mutable-class-fields.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// error-pattern:assigning to immutable field
22
class cat {
33
priv {
4-
let mutable meows : uint;
4+
let mut meows : uint;
55
}
66

77
let how_hungry : int;

src/test/run-pass/class-implement-iface-cross-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class cat implements noisy {
1515
}
1616
}
1717

18-
let mutable how_hungry : int;
18+
let mut how_hungry : int;
1919
let name : str;
2020

2121
new(in_x : uint, in_y : int, in_name: str)

src/test/run-pass/class-implement-ifaces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class cat implements noisy {
1414
}
1515
}
1616

17-
let mutable how_hungry : int;
17+
let mut how_hungry : int;
1818
let name : str;
1919

2020
new(in_x : uint, in_y : int, in_name: str)

src/test/run-pass/classes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class cat {
1010
}
1111
}
1212

13-
let mutable how_hungry : int;
13+
let mut how_hungry : int;
1414
let name : str;
1515

1616
new(in_x : uint, in_y : int, in_name: str)

0 commit comments

Comments
 (0)