Skip to content

Commit d7e9335

Browse files
committed
---
yaml --- r: 39284 b: refs/heads/incoming c: ab3b752 h: refs/heads/master v: v3
1 parent 0277d25 commit d7e9335

File tree

9 files changed

+24
-7
lines changed

9 files changed

+24
-7
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: 87f3ea7705ccc70d7a4c4cf7fe658dbd53348bf6
9+
refs/heads/incoming: ab3b75290632c963d3db3828c7ef5d28b882a46f
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/const_eval.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ fn classify(e: @expr,
103103
ast::expr_vstore_slice => classify(e, def_map, tcx),
104104
ast::expr_vstore_uniq |
105105
ast::expr_vstore_box |
106-
ast::expr_vstore_mut_box => non_const
106+
ast::expr_vstore_mut_box |
107+
ast::expr_vstore_mut_slice => non_const
107108
}
108109
}
109110

branches/incoming/src/librustc/middle/trans/expr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ fn trans_rvalue_dps_unadjusted(bcx: block, expr: @ast::expr,
535535
ast::expr_lit(@{node: ast::lit_str(s), _}) => {
536536
return tvec::trans_lit_str(bcx, expr, s, dest);
537537
}
538-
ast::expr_vstore(contents, ast::expr_vstore_slice) => {
538+
ast::expr_vstore(contents, ast::expr_vstore_slice) |
539+
ast::expr_vstore(contents, ast::expr_vstore_mut_slice) => {
539540
return tvec::trans_slice_vstore(bcx, expr, contents, dest);
540541
}
541542
ast::expr_vstore(contents, ast::expr_vstore_fixed(_)) => {

branches/incoming/src/librustc/middle/ty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,6 +3126,7 @@ fn expr_kind(tcx: ctxt,
31263126
ast::expr_repeat(*) |
31273127
ast::expr_lit(@{node: lit_str(_), _}) |
31283128
ast::expr_vstore(_, ast::expr_vstore_slice) |
3129+
ast::expr_vstore(_, ast::expr_vstore_mut_slice) |
31293130
ast::expr_vstore(_, ast::expr_vstore_fixed(_)) |
31303131
ast::expr_vec(*) => {
31313132
RvalueDpsExpr

branches/incoming/src/librustc/middle/typeck/check/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,9 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
18041804
let tt = ast_expr_vstore_to_vstore(fcx, ev, args.len(), vst);
18051805
let mutability;
18061806
match vst {
1807-
ast::expr_vstore_mut_box => mutability = ast::m_mutbl,
1807+
ast::expr_vstore_mut_box | ast::expr_vstore_mut_slice => {
1808+
mutability = ast::m_mutbl
1809+
}
18081810
_ => mutability = mutbl
18091811
}
18101812
let t: ty::t = fcx.infcx().next_ty_var();
@@ -2823,7 +2825,7 @@ fn ast_expr_vstore_to_vstore(fcx: @fn_ctxt, e: @ast::expr, n: uint,
28232825
}
28242826
ast::expr_vstore_uniq => ty::vstore_uniq,
28252827
ast::expr_vstore_box | ast::expr_vstore_mut_box => ty::vstore_box,
2826-
ast::expr_vstore_slice => {
2828+
ast::expr_vstore_slice | ast::expr_vstore_mut_slice => {
28272829
let r = fcx.infcx().next_region_var(e.span, e.id);
28282830
ty::vstore_slice(r)
28292831
}

branches/incoming/src/libsyntax/ast.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ enum expr_vstore {
441441
expr_vstore_uniq, // ~[1,2,3,4]
442442
expr_vstore_box, // @[1,2,3,4]
443443
expr_vstore_mut_box, // @mut [1,2,3,4]
444-
expr_vstore_slice // &[1,2,3,4]
444+
expr_vstore_slice, // &[1,2,3,4]
445+
expr_vstore_mut_slice, // &mut [1,2,3,4]
445446
}
446447

447448
pure fn is_blockish(p: ast::Proto) -> bool {

branches/incoming/src/libsyntax/parse/parser.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use ast::{_mod, add, arg, arm, attribute,
3737
expr_method_call, expr_paren, expr_path, expr_rec, expr_repeat,
3838
expr_ret, expr_swap, expr_struct, expr_tup, expr_unary,
3939
expr_unary_move, expr_vec, expr_vstore, expr_vstore_mut_box,
40-
expr_while, extern_fn, field, fn_decl,
40+
expr_vstore_mut_slice, expr_while, extern_fn, field, fn_decl,
4141
foreign_item, foreign_item_const, foreign_item_fn, foreign_mod,
4242
ident, impure_fn, infer, inherited,
4343
item, item_, item_class, item_const, item_enum, item_fn,
@@ -1456,6 +1456,9 @@ impl Parser {
14561456
if m == m_imm => {
14571457
expr_vstore(e, expr_vstore_slice)
14581458
}
1459+
expr_vec(*) if m == m_mutbl => {
1460+
expr_vstore(e, expr_vstore_mut_slice)
1461+
}
14591462
_ => expr_addr_of(m, e)
14601463
};
14611464
}

branches/incoming/src/libsyntax/print/pprust.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,10 @@ fn print_expr_vstore(s: ps, t: ast::expr_vstore) {
10521052
word(s.s, ~"mut");
10531053
}
10541054
ast::expr_vstore_slice => word(s.s, ~"&"),
1055+
ast::expr_vstore_mut_slice => {
1056+
word(s.s, ~"&");
1057+
word(s.s, ~"mut");
1058+
}
10551059
}
10561060
}
10571061
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
let x: &mut [int] = &mut [ 1, 2, 3 ];
3+
}
4+

0 commit comments

Comments
 (0)