Skip to content

Commit 0b55de7

Browse files
committed
---
yaml --- r: 221605 b: refs/heads/master c: 505cd8a h: refs/heads/master i: 221603: 6d7827c v: v3
1 parent a13c21d commit 0b55de7

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7a700341e7bd83cd0a36f79e95cfa29463eb77a6
2+
refs/heads/master: 505cd8a3cc9ddc89ff766a07cc90797421296d34
33
refs/heads/snap-stage3: a5c12f4e39d32af3c951b66bd2839bc0b5a1125b
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
}

0 commit comments

Comments
 (0)