On Borrow Checking

Dukc ajieskola at gmail.com
Mon May 5 06:52:09 UTC 2025


On Sunday, 4 May 2025 at 22:12:25 UTC, Walter Bright wrote:
> On 5/4/2025 11:03 AM, Dukc wrote:
>> Like I wrote above, you can only depend on `@live` for 
>> `@safe`ty if you use it everywhere.

> It doesn't have to be all or nothing in order to be useful. 
> Just like we use @safe on some functions, and @system on others.

If you mean useful as a linting tool, maybe.

But Rust's borrow checker lets you to write safe code that would 
have to be unsafe without the checker.

The D borrow checker doesn't. Everything that can be `@safe` with 
the borrow checker can be `@safe` without, _unless_ you commit to 
never use `@safe` without `@live`. If you think this isn't the 
case, try writing a code counterexample. I don't think you can do 
it.

You have to admit this makes our checker, as it currently stands, 
unusable for what many of us consider the primary purpose of a 
borrow checker.


More information about the Digitalmars-d mailing list