Closed
Description
You can currently borrow an rvalue as & or move out of it, but can't borrow it as &mut.
The use case for this is making external iterators more convenient to use by not requiring a temporary. Instead of let mut it = x.chain(y).zip(z); for it.advance |x| { ... }
it could just be for x.chain(y).zip(z).advance |x| { ... }
.
I've run into this in a few other places but I didn't think twice about it and just did the temporary workaround - but after some thought this seems like an unnecessary restriction.