2019-07-27 00:54:25 +03:00
|
|
|
// run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2013-12-12 10:42:03 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
2015-07-22 15:32:17 +02:00
|
|
|
#![allow(dead_code, unused_variables)]
|
2015-07-23 16:00:28 +02:00
|
|
|
|
2014-10-02 08:10:09 +03:00
|
|
|
// Tests that the new `box` syntax works with unique pointers.
|
2013-12-17 16:46:18 -08:00
|
|
|
|
2018-02-18 17:39:40 +00:00
|
|
|
use std::boxed::Box;
|
2013-12-17 16:46:18 -08:00
|
|
|
|
|
|
|
struct Structure {
|
2015-03-25 17:06:52 -07:00
|
|
|
x: isize,
|
|
|
|
y: isize,
|
2013-12-17 16:46:18 -08:00
|
|
|
}
|
|
|
|
|
2013-12-14 14:53:20 -08:00
|
|
|
pub fn main() {
|
2021-08-25 02:39:40 +02:00
|
|
|
let y: Box<isize> = Box::new(2);
|
|
|
|
let b: Box<isize> = Box::new(1 + 2);
|
|
|
|
let c = Box::new(3 + 4);
|
2015-07-22 15:30:05 +02:00
|
|
|
|
2021-08-25 02:39:40 +02:00
|
|
|
let s: Box<Structure> = Box::new(Structure {
|
2015-07-22 15:30:05 +02:00
|
|
|
x: 3,
|
|
|
|
y: 4,
|
2021-08-25 02:39:40 +02:00
|
|
|
});
|
2013-12-12 10:42:03 -08:00
|
|
|
}
|