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 @@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
13
13
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
14
14
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
15
15
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16
- refs/heads/auto: a87786e3e993564b444763f99dae24cdcb44a791
16
+ refs/heads/auto: 775ccadd255a034745e2b741434bd6a159a10869
17
17
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
18
18
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
19
19
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
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