2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2011-09-23 14:58:06 -07:00
|
|
|
|
2014-05-05 18:56:44 -07:00
|
|
|
struct Recbox<T> {x: Box<T>}
|
|
|
|
|
2021-08-25 02:39:40 +02:00
|
|
|
fn reclift<T>(t: T) -> Recbox<T> { return Recbox { x: Box::new(t) }; }
|
2011-09-23 14:58:06 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2015-03-25 17:06:52 -07:00
|
|
|
let foo: isize = 17;
|
|
|
|
let rbfoo: Recbox<isize> = reclift::<isize>(foo);
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(*rbfoo.x, foo);
|
2011-09-23 14:58:06 -07:00
|
|
|
}
|