Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created December 5, 2019 20:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rust-play/9f1c69705f06d7c240938b490b5374b0 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
fn func<T: ?Sized>() {
eprintln!("Size: {}", std::mem::size_of::<&T>());
}
fn main() {
func::<usize>();
func::<[usize]>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment