Advanced
Rust
Q64 / 100
What is unsafe trait and unsafe impl?
Correct! Well done.
Incorrect.
The correct answer is B) Unsafe traits (Send, Sync, GlobalAlloc) have safety invariants the compiler cannot check; unsafe impl promises the programmer upholds them
B
Correct Answer
Unsafe traits (Send, Sync, GlobalAlloc) have safety invariants the compiler cannot check; unsafe impl promises the programmer upholds them
Explanation
unsafe trait Scary {} means implementing it is unsafe. unsafe impl Scary for MyType {} promises the programmer satisfies the contract. Send and Sync are unsafe traits.
Progress
64/100