Intermediate
Rust
Q54 / 100
What is Pin<T> used for?
Correct! Well done.
Incorrect.
The correct answer is B) Preventing a value from being moved in memory, required for self-referential structs and async futures
B
Correct Answer
Preventing a value from being moved in memory, required for self-referential structs and async futures
Explanation
Pin<P> guarantees the pointee won't be moved after pinning. Async/await creates self-referential state machines that would be invalidated by moves, so futures require Pin.
Progress
54/100