First, I am speaking for myself and not my employer.

> The current proposal is to remove all autoref except for function
> invocations and indexing operations. The method of creating &T from ~T
> would be `let foo: &T = foo` or `&*foo`. Vectors and strings can't
> currently benefit from the `&*foo` syntax, but they will hopefully be
> able to do such once DST lands. In the meantime coercion via type
> ascription will work and they also have `as_slice` methods.

I am against this proposal. As I understand, we will still keep
autoref, autoborrow, etc. in method calls. So I don't think inconsistency
argument holds. Neither does local readability argument.

For local readability, which I agree is important, we have naming
conventions naming methods taking &mut self with mut_* and
methods taking by-value self with move_*. (Methods normally take
&self.) And with better tooling, function signature should be locally
accessible to the call site.

I am not in the camp of less compiler magic. Some people
seem to argue for removal of automatic coercions even in method calls,
and I am very much against that idea. Someone's magic is other's
convenience.

As for #10504, perceived asymmetry seems to originate from
the confusion of value and reference. As for inconsistency of
automatic coercions, I propose we add automatic coercions to
return expression, and any other places as we discover other
missing places.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to