Skip to content

Commit

Permalink
Add xfail'd test for rust-lang#6762.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuper committed May 27, 2013
1 parent 3941f78 commit c9c4d92
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/test/compile-fail/issue-6762.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//xfail-test

// Creating a stack closure which references an owned pointer and then
// transferring ownership of the owned box before invoking the stack
// closure results in a crash.

fn twice(x: ~uint) -> uint
{
*x * 2
}

fn invoke(f : &fn() -> uint)
{
f();
}

fn main()
{
let x : ~uint = ~9;
let sq : &fn() -> uint = || { *x * *x };

twice(x);
invoke(sq);
}

0 comments on commit c9c4d92

Please sign in to comment.