Week 10 Workshop


Before the workshop you should have watched the lectures. Some workshops have pre-workshop tasks which are optional, but useful. Completing labs before workshops is also optional (but may be useful)!

Workshop 10 - Exam Prep

This week is (as usual, now) a little bit different. We've completed all the actual work we needed to, so it's a chance for revision and extra discussions.

The first 10 minutes of the lab is set aside for you to complete the myExperience survey for COMP6991. Your answers are confidential and you should not show them to your tutor.

Then, you should please ask any questions you have about ... well, anything COMP6991 related. Your tutors will be (more than) happy to answer them!

Once you've done that, we have an exercise we hope will help you prepare for the exam. For each of the topics below, we've given one or two sample questions. Take half an hour to devise your own list of questions, and write a sample answer. Tutors will be around to help you write questions or answer them!

Basics + Borrowing + Collections

  • Pick two data types, and compare their properties.
  • Explain something about Rust's ownership or borrowing system.
  • Write a data structure which stores references to another data structure, which stores references to a datastructure.
  • Build a linked list.


  • Convert code from using one type of generic to another.
  • Explain why T is used where it is in the following example: impl<T> Type<T> {}.
  • Explain why T is used where it is in the following example: impl<T> Type<T> {}.


  • Convert a closure from being FnOnce to being Fn.
  • Call a function at random from a list.
  • Explain why Fn, FnMut and FnOnce would be chosen as an API implementer.


  • Write a macro that creates a vector containing values in reverse.
  • Explain what a particular metavariable type is.


  • Explain why a concurrency type does a particular thing.
  • Implement a sleep sort.


  • Justify why unsafe exists.
  • Take any unsafe operation and turn it safe (maybe use libc's malloc library to implement your own malloc)

Once the questions are written, you'll pass them to another group; who will get to answer them.

If you're looking for inspiration, look over the lecture and past exercises. Also, ask your tutors! They'll have ideas and suggestions for questions you could ask.

Finally, if you want to work on Assignment 2, and tutors have time, they may be able to give you advice on it.