You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
selected.borrow() is called twice, the first time to select the value from the arena and then the second time to create the split. Since the Borrow trait is not required to return the same thing twice, this can be used to create two mutable references to the same object:
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed that in the
split_at
functions:nano-arena/src/lib.rs
Lines 219 to 223 in 100568c
selected.borrow()
is called twice, the first time to select the value from the arena and then the second time to create the split. Since theBorrow
trait is not required to return the same thing twice, this can be used to create two mutable references to the same object:This outputs:
The text was updated successfully, but these errors were encountered: