You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
…ay, r=ebroto
Fix FP in `to_string_in_display`
Don't emit a lint when `.to_string()` on anything that is not `self`
Fixrust-lang#5967
changelog: Fix FP in `to_string_in_display` when calling `.to_string()` on anything that is not `self`
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 befor 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.
The text was updated successfully, but these errors were encountered: