Rust Literals and Type Specification

# Introduction In this lab, we learn about literals in Rust and how to specify their types by adding a suffix. Suffixed literals have their types known at initialization, while unsuffixed literals' types depend on how they are used. The `size_of_val` function is used to determine the size of a variable in bytes, and it is called with its full path, `std::mem::size_of_val`. The `size_of_val` function is defined in the `mem` module, which is in turn defined in the `std` crate. > **Note:** If the lab does not specify a file name, you can use any file name you want. For example, you can use `main.rs`, compile and run it with `rustc main.rs && ./main`.

|60 : 00

Click the virtual machine below to start practicing