Created
July 1, 2013 05:35
-
-
Save DaGenix/5898568 to your computer and use it in GitHub Desktop.
call twice thing
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 call(f: &fn()) { | |
f(); | |
} | |
fn call_twice(f: &fn()) { | |
call(f); | |
call(f); | |
} | |
fn main() { | |
fn test() { } | |
call_twice(test); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This results in:
moved-fn-issue.rs:9:6: 9:7 error: use of moved value:
f
moved-fn-issue.rs:9 call(f);
^
moved-fn-issue.rs:8:6: 8:7 note:
f
moved here because it has type&fn<no-bounds>()
, which is moved by default (usecopy
to override)moved-fn-issue.rs:8 call(f);
^
error: aborting due to previous error