Rust

Changing Rust Enum Variant with Mutable Reference

Changing a Rust enum variant through a mutable reference can be achieved either by wrapping the variant attached variable inside `Option`, or better, by introducing an `Undef` …

Zhiyao Ma

Rust Crate Crossbeam's ArrayQueue Can Deadlock

Although `ArrayQueue` contains no explicit spin lock or mutex, its code structure forms a big spin lock and thus deadlock is possible.

Zhiyao Ma

Call Rust Closure From Assembly Code

Calling a Rust closure from assembly code involves erasing the type and converting everything into raw pointers before passing to the assembly code, and then reconstructing Rust …

Zhiyao Ma