Skip to content

Instantly share code, notes, and snippets.

@hadronized
Created February 19, 2018 16:00
Show Gist options
  • Save hadronized/90764f7f6a978df7c4ee5952b2836644 to your computer and use it in GitHub Desktop.
Save hadronized/90764f7f6a978df7c4ee5952b2836644 to your computer and use it in GitHub Desktop.
fn correct<F>(f: F) where F: for<'a> FnOnce(&'a u32) {
f(&3)
}
fn dafuck<F>(f: F) where for<'a> F: FnOnce(&'a u32) {
f(&3)
}
fn main() {
correct(|x| println!("{}", x));
dafuck(|x| println!("{}", x));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment