]> git.lizzy.rs Git - rust.git/blob - src/test/ui/new-box-syntax.rs
Rollup merge of #61856 - c410-f3r:attrs-fn, r=matthewjasper
[rust.git] / src / test / ui / new-box-syntax.rs
1 // run-pass
2 // pretty-expanded FIXME #23616
3
4 /* Any copyright is dedicated to the Public Domain.
5  * http://creativecommons.org/publicdomain/zero/1.0/ */
6
7 #![allow(dead_code, unused_variables)]
8 #![feature(box_syntax)]
9
10 // Tests that the new `box` syntax works with unique pointers.
11
12 use std::boxed::Box;
13
14 struct Structure {
15     x: isize,
16     y: isize,
17 }
18
19 pub fn main() {
20     let y: Box<isize> = box 2;
21     let b: Box<isize> = box (1 + 2);
22     let c = box (3 + 4);
23
24     let s: Box<Structure> = box Structure {
25         x: 3,
26         y: 4,
27     };
28 }