Skip to content

Commit a81f88d

Browse files
committed
Add actual use of the struct Structure lying dormant in new-box-syntax.rs.
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`.
1 parent 9d6cc05 commit a81f88d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ pub fn main() {
3131
let y: Box<isize> = box 2;
3232
let b: Box<isize> = box()(1 + 2);
3333
let c = box()(3 + 4);
34+
35+
let s: Box<Structure> = box Structure {
36+
x: 3,
37+
y: 4,
38+
};
3439
}

0 commit comments

Comments
 (0)