Method auto-(de)ref (and lack of it) in RFC 132 ufcs

Non-method calls do have deref coercion, fully qualified[1] or not.[2] But they don't have auto-ref.

What exactly are you wishing existed?

  • Shallow auto-ref or the full method resolution (auto-ref after every deref)?
  • All parameters or only the first or only receivers?
  • Depending on how qualified the path is or not?[3]
  • Applying when? Some choices would change program semantics.

  1. UFCS is a misnomer ↩︎

  2. I always considered the "desirable not to have autoderef" comment a bit off base. It's more, "desirable to be explicit about which trait impl you're calling". ↩︎

  3. including just a bare call ↩︎

1 Like