Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created December 5, 2019 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/81407cf477693ac7a6e0d2bb13101412 to your computer and use it in GitHub Desktop.
Save rust-play/81407cf477693ac7a6e0d2bb13101412 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>());
}
trait Whatever {}
fn main() {
func::<usize>();
func::<[usize]>();
func::<dyn Whatever>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment