On 2013-11-20, at 7:13, Tommi <rusty.ga...@icloud.com> wrote:

> Yeah, my claim that it "doesn't buy us anything" stemmed from a misconception 
> that arg.foo() could move arg, given let arg: ~A; and fn foo(x: ~A) {...}. I 
> had already forgotten that Rust UFCS was specified differently from D's. To 
> anyone not following, in D it would be a simple re-write to foo(arg) and, in 
> Rust, to foo(&arg).

Scratch that. I seem to have different things mixed up now. I found this ticket 
https://github.com/mozilla/rust/issues/6974 again and it seems I should stand 
by my initial argument. Let me explain my argument again:

Our problem is that, given let arg: ~A;, seeing only foo(arg) in code doesn't 
tell us whether arg is moved or borrowed. The proposed solution is that 
auto-borrowing in that context would be deprecated and thus would require an 
explicit borrowing: foo(&*arg). Now, given that it seems that the upcoming UFCS 
would simply re-write arg.foo() to foo(arg), it would mean that seeing only 
arg.foo() in code doesn't tell us whether arg is moved or borrowed. Thus, the 
proposed solution would fix only half of the problem.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to