graydon/rust — Issue #1455: spawning a bare fn doesn't work
Author: nikomatsakis
Created: 2012-01-07 05:12:06+00:00
State: open

This should work:

```
fn foo() { }
fn bar() {
task::spawn(foo);
}
```

but it doesn't right now, because you get an error message that you are moving out of a static item. This is reasonable, as spawn's parameter is declared with move mode, but the rule doesn't make sense in this case.

Maybe the fix is to use copy mode for the task::spawn() argument, and rely on last use analysis to turn this copy into a move most of the time?