Add xfail'd test for #6762.
This commit is contained in:
parent
3941f78a1b
commit
c9c4d92889
1 changed files with 24 additions and 0 deletions
24
src/test/compile-fail/issue-6762.rs
Normal file
24
src/test/compile-fail/issue-6762.rs
Normal file
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue