Re:From Stacks to Trees: A new aliasing model for Rust
by TazeTSchnitzel on Sunday June 11, 2023 @05:04PM
(#36285657)
> silently passing something as "non mut" and it actually does "mut" stuff
No, it's the opposite that's happening here: a mutable borrow of the vector is made, and then a non-mutable thing is done with it (getting the length), before finally mutating it (pushing).
No, it's the opposite that's happening here: a mutable borrow of the vector is made, and then a non-mutable thing is done with it (getting the length), before finally mutating it (pushing).