Skip to content

Commit 440ce81

Browse files
committed
---
yaml --- r: 6293 b: refs/heads/master c: 045a437 h: refs/heads/master i: 6291: f55ad72 v: v3
1 parent 51f04aa commit 440ce81

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: f157d0b32c853250a902549b11dbd481465b8f45
2+
refs/heads/master: 045a4375561f80cc30ff15780fecc39a93c44a5b

trunk/src/comp/syntax/parse/parser.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -746,10 +746,13 @@ fn parse_path_and_ty_param_substs(p: parser) -> ast::path {
746746

747747
fn parse_mutability(p: parser) -> ast::mutability {
748748
if eat_word(p, "mutable") {
749-
if p.peek() == token::QUES { p.bump(); ret ast::maybe_mut; }
750-
ret ast::mut;
749+
if p.peek() == token::QUES { p.bump(); ast::maybe_mut }
750+
else { ast::mut }
751+
} else if eat_word(p, "const") {
752+
ast::maybe_mut
753+
} else {
754+
ast::imm
751755
}
752-
ret ast::imm;
753756
}
754757

755758
fn parse_field(p: parser, sep: token::token) -> ast::field {

trunk/src/comp/syntax/print/pprust.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ fn print_type(s: ps, &&ty: @ast::ty) {
264264
word(s.s, "[");
265265
alt mt.mut {
266266
ast::mut. { word_space(s, "mutable"); }
267-
ast::maybe_mut. { word_space(s, "mutable?"); }
267+
ast::maybe_mut. { word_space(s, "const"); }
268268
ast::imm. { }
269269
}
270270
print_type(s, mt.ty);

trunk/src/test/run-pass/maybe-mutable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
// -*- rust -*-
5-
fn len(v: [mutable? int]) -> uint {
5+
fn len(v: [const int]) -> uint {
66
let i = 0u;
77
for x: int in v { i += 1u; }
88
ret i;

trunk/src/test/run-pass/mutable-huh-variance-vec1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
// This is ok because the outer vec is covariant with respect
77
// to the inner vec. If the outer vec was mutable then we
88
// couldn't do this.
9-
fn f(&&v: [[mutable? int]]) {
9+
fn f(&&v: [[const int]]) {
1010
}
1111

1212
f(v);

trunk/src/test/run-pass/mutable-huh-variance-vec2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
// This is ok because the outer vec is covariant with respect
77
// to the inner vec. If the outer vec was mutable then we
88
// couldn't do this.
9-
fn f(&&v: [mutable? [mutable? int]]) {
9+
fn f(&&v: [const [const int]]) {
1010
}
1111

1212
f(v);

0 commit comments

Comments
 (0)