Created
June 9, 2015 19:36
-
-
Save willkelly/c6e81e42f3059ceec8b1 to your computer and use it in GitHub Desktop.
identity issues
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
$ rustc main.rs | |
main.rs:7:21: 7:29 error: unable to infer enough type information about `_`; type annotations required [E0282] | |
main.rs:7 let f = identity(identity); | |
^~~~~~~~ | |
error: aborting due to previous error |
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 identity<T>(x: T) -> T { | |
x | |
} | |
fn main() { | |
let i = identity(0); | |
let f = identity(identity); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment