graydon/rust — Issue #1038: Problem with generics and bare functions
Author: brson
Created: 2011-10-13 04:39:17+00:00
State: open
Labels: bug, design

```
fn main() {
fn# foo() { }

// This wants to build a closure over type int,
// but there's no way to do that while still being a bare function
let f: fn#() = foo::;
}
```

As a result we can't do bare-fn spawn for generic functions, which is pretty important:

```
#[test]
fn spawn_polymorphic() {
fn# foo<~T>(x: T) { log_err x; }

task::spawn2(true, foo);
task::spawn2(42, foo);
}
```