2013-05-23 21:37:37 -04:00
|
|
|
pub fn main() {
|
2013-01-10 10:59:58 -08:00
|
|
|
let foo = ~3;
|
|
|
|
let _pfoo = &foo;
|
|
|
|
let _f: @fn() -> int = || *foo + 5;
|
2013-03-15 15:24:24 -04:00
|
|
|
//~^ ERROR cannot move `foo`
|
2013-01-10 10:59:58 -08:00
|
|
|
|
2013-07-17 09:01:29 -04:00
|
|
|
// FIXME(#2202) - Due to the way that borrowck treats closures,
|
|
|
|
// you get two error reports here.
|
2013-01-10 10:59:58 -08:00
|
|
|
let bar = ~3;
|
2013-05-22 06:54:35 -04:00
|
|
|
let _g = || { //~ ERROR capture of moved value
|
2013-07-17 09:01:29 -04:00
|
|
|
let _h: @fn() -> int = || *bar; //~ ERROR capture of moved value
|
2013-01-10 10:59:58 -08:00
|
|
|
};
|
|
|
|
}
|