Skip to content

Commit 9e3183a

Browse files
committed
---
yaml --- r: 31138 b: refs/heads/dist-snap c: c84c4a8 h: refs/heads/master v: v3
1 parent 42a3d90 commit 9e3183a

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 2ea9c8df0f7c9ee72913883128b37d0a80d2f4f6
10+
refs/heads/dist-snap: c84c4a8d71914b5bc0cb3546158bc053aacb7a96
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/middle/check_const.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ fn check_item(sess: session, ast_map: ast_map::map, def_map: resolve::def_map,
3737

3838
fn check_pat(p: @pat, &&_is_const: bool, v: visit::vt<bool>) {
3939
fn is_str(e: @expr) -> bool {
40-
alt e.node { expr_lit(@{node: lit_str(_), _}) { true } _ { false } }
40+
alt e.node {
41+
expr_lit(@{node: lit_str(_), _}) |
42+
expr_vstore(@{node: expr_lit(@{node: lit_str(_), _}), _},
43+
vstore_uniq) { true }
44+
_ { false }
45+
}
4146
}
4247
alt p.node {
4348
// Let through plain string literals here

branches/dist-snap/src/rustc/middle/const_eval.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ fn eval_const_expr(tcx: middle::ty::ctxt, e: @expr) -> const_val {
103103
}
104104
}
105105
expr_lit(lit) { lit_to_const(lit) }
106+
// If we have a vstore, just keep going; it has to be a string
107+
expr_vstore(e, _) { eval_const_expr(tcx, e) }
106108
}
107109
}
108110

branches/dist-snap/src/rustc/middle/trans/alt.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ fn trans_opt(bcx: block, o: opt) -> opt_result {
4747
alt o {
4848
lit(l) {
4949
alt l.node {
50-
ast::expr_lit(@{node: ast::lit_str(s), _}) {
50+
ast::expr_lit(@{node: ast::lit_str(s), _}) |
51+
ast::expr_vstore(@{node: ast::expr_lit(
52+
@{node: ast::lit_str(s), _}), _},
53+
ast::vstore_uniq) {
5154
let strty = ty::mk_str(bcx.tcx());
5255
let cell = empty_dest_cell();
5356
bcx = tvec::trans_estr(bcx, s, ast::vstore_uniq, by_val(cell));

branches/dist-snap/src/rustc/middle/trans/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4613,7 +4613,9 @@ fn trans_enum_variant(ccx: @crate_ctxt, enum_id: ast::node_id,
46134613
fn trans_const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
46144614
let _icx = cx.insn_ctxt("trans_const_expr");
46154615
alt e.node {
4616-
ast::expr_lit(lit) { ret trans_crate_lit(cx, e, *lit); }
4616+
ast::expr_lit(lit) { trans_crate_lit(cx, e, *lit) }
4617+
// If we have a vstore, just keep going; it has to be a string
4618+
ast::expr_vstore(e, _) { trans_const_expr(cx, e) }
46174619
ast::expr_binary(b, e1, e2) {
46184620
let te1 = trans_const_expr(cx, e1);
46194621
let te2 = trans_const_expr(cx, e2);

0 commit comments

Comments
 (0)