Created
March 22, 2016 20:09
-
-
Save hadronized/d74cc0883e79d1863cd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn test() -> Foo { | |
let i = 3; | |
Foo { | |
updater: Box::new(|| println!("{}", &i)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling luminance v0.1.0 (file:///home/phaazon/dev/luminance-rs) | |
src/render.rs:35:23: 35:44 error: closure may outlive the current function, but it borrows `i`, which is owned by the current function [E0373] | |
src/render.rs:35 updater: Box::new(|| println!("{}", &i)) | |
^~~~~~~~~~~~~~~~~~~~~ | |
src/render.rs:35:23: 35:44 help: run `rustc --explain E0373` to see a detailed explanation | |
src/render.rs:35:42: 35:43 note: `i` is borrowed here | |
src/render.rs:35 updater: Box::new(|| println!("{}", &i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment