Created
April 27, 2018 06:32
-
-
Save rust-play/735efd9e0a3a371acec06e66be3e8798 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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 assert_copy<C: Copy>(_: C) {} | |
fn assert_fn<F: Fn()>(_: F) {} | |
struct Opaque(()); | |
fn main() { | |
let o = Opaque(()); | |
let f = move || { &o; }; | |
assert_copy(f); | |
assert_fn(f); | |
drop(f); | |
drop(o); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment