File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 7a700341e7bd83cd0a36f79e95cfa29463eb77a6
2
+ refs/heads/master: 505cd8a3cc9ddc89ff766a07cc90797421296d34
3
3
refs/heads/snap-stage3: a5c12f4e39d32af3c951b66bd2839bc0b5a1125b
4
4
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ allow( dead_code, unused_variables) ]
12
+ #![ feature( box_heap) ]
13
+ #![ feature( placement_in_syntax) ]
14
+
15
+ // Tests that the new `in` syntax works with unique pointers.
16
+ //
17
+ // Compare with new-box-syntax.rs
18
+
19
+ use std:: boxed:: { Box , HEAP } ;
20
+
21
+ struct Structure {
22
+ x : isize ,
23
+ y : isize ,
24
+ }
25
+
26
+ pub fn main ( ) {
27
+ let x: Box < isize > = in HEAP { 2 } ;
28
+ let b: Box < isize > = in HEAP { 1 + 2 } ;
29
+ let c = in HEAP { 3 + 4 } ;
30
+
31
+ let s: Box < Structure > = in HEAP {
32
+ Structure {
33
+ x : 3 ,
34
+ y : 4 ,
35
+ }
36
+ } ;
37
+ }
You can’t perform that action at this time.
0 commit comments