summaryrefslogtreecommitdiffstats
path: root/tests/ui/generics/generic-exterior-unique.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generics/generic-exterior-unique.rs')
-rw-r--r--tests/ui/generics/generic-exterior-unique.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/generics/generic-exterior-unique.rs b/tests/ui/generics/generic-exterior-unique.rs
new file mode 100644
index 000000000..10d87f9f4
--- /dev/null
+++ b/tests/ui/generics/generic-exterior-unique.rs
@@ -0,0 +1,11 @@
+// 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);
+}