Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created February 20, 2013 21:01
Show Gist options
  • Save jbclements/4999580 to your computer and use it in GitHub Desktop.
Save jbclements/4999580 to your computer and use it in GitHub Desktop.
This file displays the "mutable variables cannot be implicitly captured" error
pub struct Bogo {
x: fn@() -> uint
}
pub fn bugfun2(_exts: @mut uint)
-> uint { 3 }
pub fn bugfun() {
let mut exts = 146;
let _f_pre = @Bogo {
x: || bugfun2(@mut exts),
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment