Accepting nested method calls with an `&mut self` receiver

Broadly speaking, I think my preference would be to autoref and normalize to UFCS form, then apply a consistent evaluation strategy from there. That is, autoref method calls should be semantically equivalent to explicit UFCS, which as little additional magic as possible (autoref already being plenty of magic to worry about).

If arguments and borrowing were evaluated right-to-left, then I think your Proposal 1 would fall out naturally from UFCS, no? vec.push(vec.len()) -> Vec::push(&mut vec, Vec::len(&vec)) would take &vec and evaluate the length first, then take the &mut vec and call push.

But now I recall past threads where it seems Rust prefers LTR, namely #28160 and these:

4 Likes