Complete the lab with a working references, borrowing, and lifetimes example with an explicit success and failure check.
Guided Lab: References, Borrowing, and Lifetimes in Rust Programming Fundamentals
Rust Programming Fundamentals — References, Borrowing, and Lifetimes lab: Create a small program that allocates or owns a resource, passes access safely, and releases it without leaks or dangling access.
Know what success looks like before you begin
Save verification evidence: the relevant output, test, log, query result, or rendered state for References, Borrowing, and Lifetimes.
- I completed the module-specific practice task.
- I produced a working references, borrowing, and lifetimes example with an explicit success and failure check.
- I saved the relevant output, test, log, query result, or rendered state for References, Borrowing, and Lifetimes.
- I diagnosed and corrected one realistic References, Borrowing, and Lifetimes failure.
Stop before using production credentials, important data, shared permissions, live infrastructure, or destructive commands that are not required by the lab.
Jump to a section
Know the problem and the evidence you need
Create a small program that allocates or owns a resource, passes access safely, and releases it without leaks or dangling access.
a working references, borrowing, and lifetimes example with an explicit success and failure check
Complete the task, verify the relevant output, test, log, query result, or rendered state for References, Borrowing, and Lifetimes, then diagnose one failure that is specific to References, Borrowing, and Lifetimes.
Understand who owns a resource, how long it is valid, and what operations can move, borrow, free, or invalidate it.
Prepare before changing anything
Have this ready
- Open a small local project or disposable lab environment.
- Confirm the runtime, toolchain, or service needed for the module.
- Prepare one valid input and one invalid or boundary input.
Run the lab
Complete one check at a time. Record the evidence before moving on.
Match the evidence to the next action
The expected result appears and the boundary case behaves correctly
Save the result and continue to the module checkpoint.
The normal case works but the failure or boundary case does not
Return to the diagnostic step and inspect the module-specific state or output before changing more code.
The result changes between runs
Compare the relevant input, dependency, configuration, data, state, or runtime version for this module.
Choose the next action
Complete the lab when you can reproduce the working result, explain the important module decision, and recover from the tested failure.
Confirm the evidence you produced
Finished record: a working references, borrowing, and lifetimes example with an explicit success and failure check
- I completed the module-specific practice task.
- I produced a working references, borrowing, and lifetimes example with an explicit success and failure check.
- I saved the relevant output, test, log, query result, or rendered state for References, Borrowing, and Lifetimes.
- I diagnosed and corrected one realistic References, Borrowing, and Lifetimes failure.