Skip to content

Commit dfee55b

Browse files
committed
---
yaml --- r: 33679 b: refs/heads/snap-stage3 c: b7c04d1 h: refs/heads/master i: 33677: 97d4e9c 33675: e17589b 33671: 9c392d2 33663: f113cbc v: v3
1 parent fe15aa6 commit dfee55b

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f4a5a76aa4596b3892dced83e3e2bea082e20c48
4+
refs/heads/snap-stage3: b7c04d152b92f137cd452ea45dcb9d2568953c86
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/mem_categorization.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,8 @@ impl &mem_categorization_ctxt {
797797

798798
deref_comp(_) => {
799799
// fixed-length vectors have no deref
800-
comp(expr, base_cmt, base_cmt.ty, mt.mutbl, mt.ty)
800+
let m = self.inherited_mutability(base_cmt.mutbl, mt.mutbl);
801+
comp(expr, base_cmt, base_cmt.ty, m, mt.ty)
801802
}
802803
};
803804

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
fn test1() {
2+
let mut ints = [0, ..32];
3+
ints[0] += 1;
4+
assert ints[0] == 1;
5+
}
6+
7+
fn test2() {
8+
let mut ints = [0, ..32];
9+
for vec::each_mut(ints) |i| { *i += 22; }
10+
for ints.each |i| { assert *i == 22; }
11+
}
12+
13+
fn main() {
14+
test1();
15+
test2();
16+
}

0 commit comments

Comments
 (0)