News for hackers. Stuff that matters.
Re:I Want Off Mr. Golang's Wild Ride by hope-striker on Friday February 28, 2020 @03:32PM (#22446064)
The value in Rust does not depend on f.

I will be precise. There is no definition of f such that this function will print anything other than "4".

    fn main() {
        let mut x = 4;
        f(x);
        println!("{}", x);
    }
Again, you seem to be confusing mutable references and mutable variables. If I had written f(&mut x) rather than f(x), you would be right.

There are no comments on this comment yet.