File tree Expand file tree Collapse file tree 4 files changed +34
-8
lines changed Expand file tree Collapse file tree 4 files changed +34
-8
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: a87786e3e993564b444763f99dae24cdcb44a791
4
+ refs/heads/snap-stage3: 775ccadd255a034745e2b741434bd6a159a10869
5
5
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -2326,6 +2326,22 @@ impl Parser {
2326
2326
_ => self . mk_unary ( UnUniq , e)
2327
2327
} ;
2328
2328
}
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
+ }
2329
2345
_ => return self . parse_dot_or_call_expr ( )
2330
2346
}
2331
2347
return self . mk_expr ( lo, hi, ex) ;
Original file line number Diff line number Diff line change @@ -465,15 +465,17 @@ declare_special_idents_and_keywords! {
465
465
( 45 , While , "while" ) ;
466
466
( 46 , Continue , "continue" ) ;
467
467
( 47 , Proc , "proc" ) ;
468
+ ( 48 , Box , "box" ) ;
468
469
469
470
' 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" ) ;
477
479
}
478
480
}
479
481
Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments