DIP 1028---Make @safe the Default---Community Review Round 1

Mathias Lang pro.mathias.lang at gmail.com
Wed Jan 8 05:47:15 UTC 2020


On Saturday, 4 January 2020 at 10:22:34 UTC, WebFreak001 wrote:
> On Friday, 3 January 2020 at 22:36:17 UTC, Alex wrote:
>> [...]
>> Not sure, if this fits here. But if I add ´´´@safe:´´´ at the 
>> beginning of the module, the library 
>> https://code.dlang.org/packages/vebtree does not compile any 
>> more.
>
> you can't just slap `@safe:` on because all the libraries and 
> stuff you depend on which wasn't marked @safe is still gonna 
> stay @system and thus disallow your calls. Instead you need to 
> use the compiler with the @safe by default PR.
>
> I have done this for all dub packages now so everyone can 
> review what this change actually does to their packages:
>
> https://i.webfreak.org/safe-test/index.html
>
> It seems that your vebtree package compiles fine, however that 
> is not to say for the rest of dub. Currently a lot of issues 
> are caused by phobos' std.bitmanip.bitfields. So a lot of these 
> errors are certainly fixable, but currently it doesn't look 
> good in terms of support. (Tested using phobos 
> v2.089.1-198-gbb8ba28bf)

When providing results, it is best to provide your methodology 
alongside them so people can reproduce. So is there somewhere 
public I can find your build scripts ?

I myself gave a try to the switch, but I didn't expect *anything* 
to work, as I was sure druntime/Phobos would not compile with 
'-preview=safedefault', and as I mentioned already, we'll hit 
linker error if we don't compile them with '-preview=safedefault'.

The results I got were as I expected 
(https://github.com/dlang/dmd/pull/10709#issuecomment-571899986), 
which seems to be at odds with what you're seeing.


More information about the Digitalmars-d mailing list