News for hackers. Stuff that matters.
Re:Announcing Rust 1.22 by gpderetta on Thursday November 23, 2017 @05:13AM (#15764115)

  int x[] = {5};
  f(x);
  // WHAT IS THE VALUE OF X HERE?
see, it works in C as well.
Re:Announcing Rust 1.22 by cesarb on Thursday November 23, 2017 @05:39AM (#15764205)
In C, the value of x in that fragment is still the same: a pointer (ok, not exactly, but something which behaves like a pointer) to a memory location where an int can be stored. The f(x) call can't change that pointer.
Re:Announcing Rust 1.22 by int_19h on Thursday November 23, 2017 @06:21AM (#15764364)
Try doing something like &x, and you'll see that it doesn't actually reliably behave like a pointer.
Re:Announcing Rust 1.22 by fredmorcos on Thursday November 23, 2017 @08:26AM (#15764873)
So you get my point. 'x' is not going to be modified behind your back and it's pretty clear on the calling site. In C++ it isn't clear.
Re:Announcing Rust 1.22 by gpderetta on Thursday November 23, 2017 @09:16AM (#15765171)
It is exactly the same between the two cases: the x object (either the array memory location or the integer memory location) can be changed by 'f' because mentioning the 'x' object name in a function call may implicitly converts to the address of the object, i.e. it passes by reference).
Re:Announcing Rust 1.22 by fredmorcos on Thursday November 23, 2017 @10:51AM (#15765757)
> can be changed by 'f' because mentioning the 'x' object name in a function call may implicitly converts to the address of the object

(1) They are two different types and (2) it's clear to you at the calling site!