]> git.proxmox.com Git - rustc.git/blob - tests/ui/box/new-box-syntax.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / box / 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
9 // Tests that the new `box` syntax works with unique pointers.
10
11 use std::boxed::Box;
12
13 struct Structure {
14 x: isize,
15 y: isize,
16 }
17
18 pub fn main() {
19 let y: Box<isize> = Box::new(2);
20 let b: Box<isize> = Box::new(1 + 2);
21 let c = Box::new(3 + 4);
22
23 let s: Box<Structure> = Box::new(Structure {
24 x: 3,
25 y: 4,
26 });
27 }