Closed
Description
The core implementation of the swap method in a matrix looks like this:
Lines 155 to 162 in 38add0b
If
i1
and i2
are equal, this method will cause mutable aliasing, which is undefined behavior under Rust's aliasing rules. However, the safe swap
methods don't check this:Lines 1162 to 1175 in 38add0b
Edit: using ptr::swap
instead of mem::swap
fixes this.
Metadata
Metadata
Assignees
Labels
No labels