DIP77 - Fix unsafe RC pass by 'ref'

via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 10 07:28:30 PDT 2015


On Thursday, 9 April 2015 at 22:06:01 UTC, Walter Bright wrote:
> I was curious how Rust handled the global variable issue. Turns 
> out it doesn't - mutable global variables are marked as 
> "unsafe" and the checker gives up on it.

I think it's safe to say that if even Rust with its linear type 
system and advanced borrow checker cannot deal with it, noone 
can, short of whole program analysis. And it's easy to understand 
why once you realize that it's all about aliasing. That's why I 
also suggest to make borrowing from mutable globals unsafe.


More information about the Digitalmars-d mailing list