Skip to content

Commit 1802cdc

Browse files
committed
---
yaml --- r: 88633 b: refs/heads/snap-stage3 c: 775ccad h: refs/heads/master i: 88631: d5f7f65 v: v3
1 parent 9c71c44 commit 1802cdc

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: a87786e3e993564b444763f99dae24cdcb44a791
4+
refs/heads/snap-stage3: 775ccadd255a034745e2b741434bd6a159a10869
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,6 +2326,22 @@ impl Parser {
23262326
_ => self.mk_unary(UnUniq, e)
23272327
};
23282328
}
2329+
token::IDENT(_, _) if self.is_keyword(keywords::Box) => {
2330+
self.bump();
2331+
2332+
let subexpression = self.parse_prefix_expr();
2333+
hi = subexpression.span.hi;
2334+
// HACK: turn `box [...]` into a boxed-evec
2335+
ex = match subexpression.node {
2336+
ExprVec(..) |
2337+
ExprLit(@codemap::Spanned {
2338+
node: lit_str(..),
2339+
span: _
2340+
}) |
2341+
ExprRepeat(..) => ExprVstore(subexpression, ExprVstoreUniq),
2342+
_ => self.mk_unary(UnUniq, subexpression)
2343+
};
2344+
}
23292345
_ => return self.parse_dot_or_call_expr()
23302346
}
23312347
return self.mk_expr(lo, hi, ex);

branches/snap-stage3/src/libsyntax/parse/token.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,17 @@ declare_special_idents_and_keywords! {
465465
(45, While, "while");
466466
(46, Continue, "continue");
467467
(47, Proc, "proc");
468+
(48, Box, "box");
468469

469470
'reserved:
470-
(48, Alignof, "alignof");
471-
(49, Be, "be");
472-
(50, Offsetof, "offsetof");
473-
(51, Pure, "pure");
474-
(52, Sizeof, "sizeof");
475-
(53, Typeof, "typeof");
476-
(54, Yield, "yield");
471+
(49, Alignof, "alignof");
472+
(50, Be, "be");
473+
(51, Offsetof, "offsetof");
474+
(52, Pure, "pure");
475+
(53, Sizeof, "sizeof");
476+
(54, Typeof, "typeof");
477+
(55, Unsized, "unsized");
478+
(56, Yield, "yield");
477479
}
478480
}
479481

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* Any copyright is dedicated to the Public Domain.
2+
* http://creativecommons.org/publicdomain/zero/1.0/ */
3+
4+
fn main() {
5+
let x: ~int = box 3;
6+
println!("{}", *x);
7+
}
8+

0 commit comments

Comments
 (0)