Borrowing Rules Exercises

A core primer on Rust's Borrowing Rules - Understand the fundamental principles that allow Rust to guarantee memory safety by managing data access, preventing data races and dangling references. Solidify your knowledge by tackling exercises on mutable reference conflicts and adapting function signatures for proper reference handling.


1. Stack And Heap
An illuminating exploration of Understanding Stack and Heap Memory in Rust - Discover how Rust manages program memory across the fast, fixed-size stack and the flexible, dynamic heap. You'll learn to identify where different data types are stored and why this is crucial for Rust's memory safety and efficiency. Duration: 3min
2. Ownership
A crucial guide to Understanding Rust Ownership - Master Rust's memory safety by learning its three fundamental rules: values have a single owner, data moves (e.g., `String`), and values drop when out of scope. Discover how the `Copy` trait allows types like `i32` to be duplicated, providing an important exception for efficient, safe code without a garbage collector. Duration: 7min
3. Ownership Exercises
A hands-on introduction to Ownership - Explore Rust's memory management by learning about variable ownership, moves, and scope. You'll debug code by commenting out lines that cause ownership errors after values are moved. Reading Time: 0min
5. Borrowing Rules
A clear pathway to Understanding Borrowing and References in Rust - Uncover how Rust's borrowing allows functions to use data via references without taking ownership, enhancing flexibility. Master the rules for immutable and mutable borrows, and how Rust's compile-time checks prevent dangling references for robust, memory-safe programs. Duration: 9min
6. Borrowing Rules Exercises
A core primer on Rust's Borrowing Rules - Understand the fundamental principles that allow Rust to guarantee memory safety by managing data access, preventing data races and dangling references. Solidify your knowledge by tackling exercises on mutable reference conflicts and adapting function signatures for proper reference handling. Reading Time: 0min

Course Overview

About the course

What you'll learn

Introduction to the Rust programming language

Rust variables and functions

Scalar types, arrays, strings, enum, structs, vectors, and hash maps in Rust

Rust control flows: If / else, if let and let else, loop, match

Rust ownership, including borrow and references

Rust error handling

Rust Modules

Rust Traits

Course Description

Who is this course for?

  • Smart Contract Developers
  • Blockchain Engineers
  • Web3 Developers
  • Smart Contract Security Researchers
  • Solutions Architects

Meet your instructors

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

Last updated on August 15, 2025