module bitintsafe;
import std.bigint;
void main() @safe
{
BigInt i, j, k;
i = j + k;
}
$ dmd -c bigintsafe.d
bigintsafe.d(8): Error: safe function 'D main' cannot call system function 'std.bigint.BigInt.opBinary!("+", BigInt).opBinary'
I started looking into this but the rabit hole is fairly deep. Filing a bug in hopes that someone will take up the charge on this one while I work on others. I don't consider this an enhancement request since @safe and phobos really need to be in the 'just works' state.
It also suffered from being too big. It would have been nice to get the non-controversial parts of the change in. There was very little use of the @trusted sledge hammer.
A further step in this direction:
https://github.com/dlang/phobos/pull/5354
It's still not complete; BigInt is a pretty deep rabbit warren that will need some time to completely sort out. One step at a time!
Comment #6 by hsteoh — 2017-04-26T18:45:08Z
What should be done about the inline asm heavily used by the BigInt implementation? We could use the sledgehammer approach and slap @trusted on all the inline asm code, but I'm a bit hesitant to do that.
Comment #7 by bugzilla — 2019-12-24T12:48:11Z
This is more an enhancement, than a bug. Isn't it?
Comment #8 by robert.schadek — 2024-12-01T16:22:41Z