mozilla/rust — Issue #1896: closure in record triggers a memory leak and abort
Author: erickt
Created: 2012-02-24 09:16:17+00:00
State: open
Labels: I-crash

There seems to be an issue with closures in records and the type checker. This code segfaults with a leaked memory message:

type t = { f: fn() -> T };

fn f(_x: t) {}

fn main() {
let x: t<()> = { f: { || () } };
f(x);
}

However, if you remove `: t<()>` from `let x: t<()> = { f: { || () } };`, it works just fine.