-
General
-
Mutability - Variables are immutable by default
-
Structs 1 - types of struct
-
Structs 2 - Show impl on structs
-
-
Examples for Type Safety
-
Typing Error 1 C - signed/unsigned (assignment)
-
Typing Error 1 Rust - signed/unsigned (assignment)
-
Typing Error 2 C - signed/unsigned comparison (int)
-
Typing Error 2 Rust - signed/unsigned comparison (int)
-
Typing Error 3 C - signed/unsigned comparison (char)
-
Typing Error 3 Rust - signed/unsigned comparison (char)
-
Examples for Memory Safety
-
Concurrency Examples
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
apt install build-essential
yum install gcc
You can run any of the code examples by using cargo run --example [example]
.
You can compile the error code by using cargo run --example [example] --features=broken
.
To run the mutex example, execute the following commands:
cargo run --example mutex
cargo run --example mutex --features=broken