]> git.lizzy.rs Git - rust.git/commitdiff
Add actual use of the `struct Structure` lying dormant in `new-box-syntax.rs`.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 22 Jul 2015 13:30:05 +0000 (15:30 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 22 Jul 2015 13:34:01 +0000 (15:34 +0200)
The original test program exercised the (garbage-collected heap)
allocation form `box (GC) ...`, feeding an instance of `Structure` in
as the expression. This obviously went away when `GC` went away, but
there's no reason for us not to include an appropriate unit test here
for the same form, just for heap-allocated instances of `Structure`.

src/test/run-pass/new-box-syntax.rs

index d2ebd6863fa6d6a95a66108eb87e27b0622c02c9..503699950012c94e95a80816d6b0f8c9f6e45a31 100644 (file)
@@ -31,4 +31,9 @@ pub fn main() {
     let y: Box<isize> = box 2;
     let b: Box<isize> = box()(1 + 2);
     let c = box()(3 + 4);
+
+    let s: Box<Structure> = box Structure {
+        x: 3,
+        y: 4,
+    };
 }