Skip to content

Commit 9aa8064

Browse files
committed
---
yaml --- r: 92319 b: refs/heads/auto c: 775ccad h: refs/heads/master i: 92317: 24868db 92315: 24738b9 92311: 6a4885b 92303: b386800 92287: f97c3c3 v: v3
1 parent b04e9ac commit 9aa8064

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
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: a87786e3e993564b444763f99dae24cdcb44a791
16+
refs/heads/auto: 775ccadd255a034745e2b741434bd6a159a10869
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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)