Strangeness in pattern matching mutable references in nested structs

There's another bug report related to this, similar to the one linked in that StackOverflow thread but with a bit more discussion: https://github.com/rust-lang/rust/issues/62013

I didn't follow all of the details, but I believe the difference in behavior here is unintentional and will be fixed eventually. When compiling with the next-generation borrow checker Polonius, both functions compile successfully.

3 Likes