Skip to content

Commit 180bc2f

Browse files
committed
---
yaml --- r: 38956 b: refs/heads/incoming c: b7c04d1 h: refs/heads/master v: v3
1 parent 29a38cc commit 180bc2f

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
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: f4a5a76aa4596b3892dced83e3e2bea082e20c48
9+
refs/heads/incoming: b7c04d152b92f137cd452ea45dcb9d2568953c86
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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)