rust/tests/ui/generics/generic-exterior-unique.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
243 B
Rust
Raw Normal View History

// run-pass
struct Recbox<T> {x: Box<T>}
fn reclift<T>(t: T) -> Recbox<T> { return Recbox { x: Box::new(t) }; }
pub fn main() {
let foo: isize = 17;
let rbfoo: Recbox<isize> = reclift::<isize>(foo);
assert_eq!(*rbfoo.x, foo);
}