-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Description
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.
For example, in Rust 0.6, this will compile
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);
}
and the resulting program will then crash with a SEGV
Metadata
Metadata
Assignees
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.