Rust Quiz
Check your understanding of the whole Rust tutorial with these questions.
How the Quiz Works
- 9 questions cover every lesson
- Choose one answer for each question
- An explanation appears after you answer
- Read the related lesson again for any question you miss
Quiz Questions
Exercise
What is Rust's build tool and package manager called?
Exercise
Are Rust variables mutable by default?
Exercise
What does 1..=3 contain?
Exercise
In a function, what happens to the last expression written without a semicolon?
Exercise
After let b = a; where a is a String, what happens to a?
Exercise
How many mutable references to one value can exist at the same time?
Exercise
Which macro creates a vector quickly?
Exercise
What does a function return if it may fail with an error?
Exercise
Which line lets you print a struct with {:?}?
What Next?
Excellent work. Rust takes practice, so keep writing small programs. Next, read about traits, generics, lifetimes and error handling with ?, then try building a command-line tool with Cargo.
The Rust compiler is your teacher. When it shows an error, read the whole message: it often tells you exactly how to fix the problem.
