2012-05-07 11:31:57 -07:00
|
|
|
fn foo(_f: fn()) {}
|
|
|
|
fn bar(_f: @int) {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = @3;
|
2012-06-26 13:55:56 -07:00
|
|
|
foo({|| bar(x); });
|
2012-05-07 11:31:57 -07:00
|
|
|
|
|
|
|
let x = @3;
|
2012-06-26 13:55:56 -07:00
|
|
|
foo({|copy x| bar(x); }); //! ERROR cannot capture values explicitly with a block closure
|
2012-05-07 11:31:57 -07:00
|
|
|
|
|
|
|
let x = @3;
|
2012-06-26 13:55:56 -07:00
|
|
|
foo({|move x| bar(x); }); //! ERROR cannot capture values explicitly with a block closure
|
2012-05-07 11:31:57 -07:00
|
|
|
}
|
|
|
|
|