Steven Blenkinsop wrote:
Under the new borrowing rules, if &const were removed, wouldn't it be safe to temporarily deinitialize a mutably borrowed value as long as it can be statically guaranteed that you reinitialize it before the next use?

Perhaps. Right now we only track this at the resolution of local variables, but it would be possible to extend it to something finer-grained. In this case, though, the value was accessed through an `&mut`, which means we'd have to be extra careful, particularly around function calls, as there may be other ways to read the value than what we can immediately see.


Niko
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to