I definitely see it being a nice feature that Rust programmers should be able to specify. But it also seems like it could be automated. If the variable is going to be used again, don’t destroy it within the function instead of forcing a borrow. Why can’t mut be mutable by default? And a warning if it could be immutable. I’m sure a few other things.
It is quite nice from the security and safety point of view and because it seems like Rust magically catches most of your bugs. If you can make it through the compiler, your code usually works. And it forces the programmer to think about these things. Which is awesome, but I guess my point is, it does scare some people away. What if we had a beginner and advanced Rust, and similar to making code unsafe, you could mark it as ‘lazy’ or something where things could be automated?
Mostly curious to hear thoughts. I personally would always want the current/unlazy version of Rust since my current project needs high security. And I guess from a security perspective, nice to know libraries I’m calling do the same.
But might win over some people currently complaining about the learning curve.