Skip to content

Commit 0b127c8

Browse files
committed
---
yaml --- r: 40386 b: refs/heads/dist-snap c: b7c04d1 h: refs/heads/master v: v3
1 parent f39957b commit 0b127c8

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: f4a5a76aa4596b3892dced83e3e2bea082e20c48
10+
refs/heads/dist-snap: b7c04d152b92f137cd452ea45dcb9d2568953c86
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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)