From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/generics/generic-exterior-unique.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/ui/generics/generic-exterior-unique.rs (limited to 'tests/ui/generics/generic-exterior-unique.rs') 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 {x: Box} + +fn reclift(t: T) -> Recbox { return Recbox { x: Box::new(t) }; } + +pub fn main() { + let foo: isize = 17; + let rbfoo: Recbox = reclift::(foo); + assert_eq!(*rbfoo.x, foo); +} -- cgit v1.2.3