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