DIP1028 - Rationale for accepting as is

Timon Gehr timon.gehr at gmx.ch
Tue May 26 12:06:16 UTC 2020


On 26.05.20 13:09, Atila Neves wrote:
> On Monday, 25 May 2020 at 17:01:24 UTC, Panke wrote:
>> On Monday, 25 May 2020 at 16:29:24 UTC, Atila Neves wrote:
>>> A few years ago I submitted several PRs to Phobos to mark all 
>>> unittests that could with @safe explicitly. I'd say that was a good 
>>> example of nobody reviewing them for their @systemness.
>>
>> Ideally you should be able to blindly mark every function definition 
>> with @safe, because the compiler will catch you if you fall. Only if 
>> you type @trusted you should need to be careful.
> 
> Doesn't work for templated functions since their @safety might depend on 
> the the particular instantiation (consider std.algorithm.map).

I think the point was that annotating with @safe liberally should not 
enable memory corruption.


More information about the Digitalmars-d-announce mailing list