Skip to content

Instantly share code, notes, and snippets.

@willkelly
Created June 9, 2015 19:36
Show Gist options
  • Save willkelly/c6e81e42f3059ceec8b1 to your computer and use it in GitHub Desktop.
Save willkelly/c6e81e42f3059ceec8b1 to your computer and use it in GitHub Desktop.
identity issues
$ 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
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