Skip to content

Commit ea67099

Browse files
committed
Add support for mutable unique boxes
Issue #409
1 parent 1b3023e commit ea67099

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/comp/middle/mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn expr_root(tcx: ty::ctxt, ex: @expr, autoderef: bool) ->
8686
let mut = false;
8787
alt ty::struct(tcx, base_t) {
8888
ty::ty_box(mt) { mut = mt.mut != imm; }
89-
ty::ty_uniq(_) { }
89+
ty::ty_uniq(mt) { mut = mt.mut != imm; }
9090
ty::ty_res(_, _, _) { }
9191
ty::ty_tag(_, _) { }
9292
ty::ty_ptr(mt) { mut = mt.mut != imm; }

src/test/run-pass/unique-mutable.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
let i = ~mutable 0;
3+
*i = 1;
4+
assert *i == 1;
5+
}

0 commit comments

Comments
 (0)