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