Why is rehash not @safe?

2014-08-30 Thread Nordlöw
I just noticed that AA rehash is @system. Is there a reason for this? Is it system because bad things can happen or simply because it's a low level function? Should I always tag functions calling rehash as @trusted?

Re: Why is rehash not @safe?

2014-08-30 Thread Orvid King via Digitalmars-d-learn
On 8/30/2014 9:27 AM, Nordlöw wrote: I just noticed that AA rehash is @system. Is there a reason for this? Is it system because bad things can happen or simply because it's a low level function? Should I always tag functions calling rehash as @trusted? Rehash itself would have to be marked

Re: Why is rehash not @safe?

2014-08-30 Thread Nordlöw
On Saturday, 30 August 2014 at 14:55:19 UTC, Orvid King wrote: Rehash itself would have to be marked @trusted rather than @safe if anything. I agree, that would be more in line with my understanding of when to use @trusted---when a function is safe but it can't be proven through the

Re: Why is rehash not @safe?

2014-08-30 Thread Nordlöw
On Saturday, 30 August 2014 at 15:32:36 UTC, Nordlöw wrote: I agree, that would be more in line with my understanding of when to use @trusted---when a function is safe but it can't be proven through the type-system. Should I change it to @trusted in a PR?

Re: Why is rehash not @safe?

2014-08-30 Thread ketmar via Digitalmars-d-learn
On Sat, 30 Aug 2014 15:36:12 + Nordlöw via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Should I change it to @trusted in a PR? i think it would be good. it's the way it works. there are some places where such flags aren't set in druntime, and we should clean that up one by

Re: Why is rehash not @safe?

2014-08-30 Thread monarch_dodra via Digitalmars-d-learn
On Saturday, 30 August 2014 at 14:27:04 UTC, Nordlöw wrote: I just noticed that AA rehash is @system. Is there a reason for this? Is it system because bad things can happen or simply because it's a low level function? Should I always tag functions calling rehash as @trusted? AFAIK, the whole

Re: Why is rehash not @safe?

2014-08-30 Thread Nordlöw
On Saturday, 30 August 2014 at 17:31:54 UTC, monarch_dodra wrote: Really, it's lose-lose. The only (AFAIK) solution is to migrate AA's to a template-library that individually infers the correct safety for every types. Isn't there anyway to say that rehash() should infer safeness from

Re: Why is rehash not @safe?

2014-08-30 Thread via Digitalmars-d-learn
On Saturday, 30 August 2014 at 17:31:54 UTC, monarch_dodra wrote: On Saturday, 30 August 2014 at 14:27:04 UTC, Nordlöw wrote: I just noticed that AA rehash is @system. Is there a reason for this? Is it system because bad things can happen or simply because it's a low level function? Should I

Re: Why is rehash not @safe?

2014-08-30 Thread Nordlöw
On Saturday, 30 August 2014 at 18:16:37 UTC, Marc Schütz wrote: This means that _aaRehash() can probably marked as @trusted; rehash() will then be automatically inferred as @safe, because it's a set of templates. https://github.com/D-Programming-Language/druntime/pull/942