How come this builds:
let len = file.read(&mut buf)?; let curslice = &buf[..len];
But this doesn't?
let curslice = &buf[..file.read(&mut buf)?];
I mean, sure, I get that the mutable borrow is held for the entire duration of the statement so the immutable borrow can't happen, but... the mutable borrow clearly isn't needed anymore so why not just end its lifetime before the immutable starts? I thought Non-Lexical Lifetimes was implemented to fix things like that. What gives?