why does my async fn hold a borrow across await
I have an async function that takes &mut Vec<u8>, pushes some bytes, awaits a socket write, then pushes more bytes. I keep getting E0502 about a second mutable borrow even though the pushes are in separate statements. It feels like the compiler thinks the whole function holds the borrow for its entire duration. What's actually going on? Happy to share more detail if it helps.
4 replies