Prototype of Ownership/Borrowing System for D

Doc Andrew x at x.com
Sun Nov 24 21:51:08 UTC 2019


On Sunday, 24 November 2019 at 14:51:31 UTC, Timon Gehr wrote:
>
> This is indeed what Rust does. In D, raw pointers without 
> additional semantics can actually be fine in @safe code (for 
> example, `new int` returns an `int*`, and so does `&x` for a 
> module-level (thread-local) `int x;`), but @trusted and @system 
> code has to be careful what raw pointers it passes to @safe 
> functions.
>

I just saw this article that might be helpful:
https://plv.mpi-sws.org/rustbelt/stacked-borrows/

I'm dealing with sick kiddos today so haven't had time to go over 
it in much (any) detail, but it looks like an attempt to solve 
the aliasing problem caused by raw pointers when passed to 
otherwise safe code.



More information about the Digitalmars-d mailing list