Closed
Description
This code compiles on 1.16.0, but errors on 1.17.0:
error[E0502]: cannot borrow `buf` as mutable because it is also borrowed as immutable
--> examples/http-server.rs:49:63
|
49 | let len = try!(conn.read(&mut buf[buf_i..]));
| ^^^ mutable borrow occurs here
...
58 | let res = req.parse(&buf[0..buf_i]).unwrap();
| --- immutable borrow occurs here
...
77 | });
| - immutable borrow ends here
Reproduced and confirmed by another person on #rust
. I'm working on minimizing, but since it's late, I might not be able to deliver today.