-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recursively add toHash @safe
and nothrow
#254
base: master
Are you sure you want to change the base?
Conversation
I removed heapValue from the VObjectKey union because it wasn't used and made it too difficult to prove safety
I think this is a definite step back:
If anything needs to be solved here, it is DMD's glacial release pace. PS: I expect this to break on LDC, because mulhi would not be inferred to be @safe there. |
This is up to the developer / project guidelines how you make them seen, such as through formatting or by saying you put them (
I don't think that's true. Bit tricks are at least always nothrow and I think the rules when to use
That's true when the code isn't used elsewhere / exposed as public API, but otherwise such restrictions are very useful for other library authors that might want to do some optimization. (e.g. HashMap container authors don't need to wrap each index access with try-catch + don't need to lie about safety or make an unsafe library) I don't think it's the compilers job to give out this warning though, it should rather be part of the linter. (which would also of course fit very nicely into the compilation step, but we would need the ability to configure warnings per-project, per-module, per-scope, per-line if we went this route) I think safety attributes have value in every project, especially when you start developing functionality on top of your bit hacks structs. When at that point it's nice to have |
f94baa8
to
87a9baf
Compare
cf07b66
to
39f39ba
Compare
4acd1ab
to
e854d3d
Compare
0896895
to
5a79292
Compare
7ce40a5
to
4dbe602
Compare
I removed heapValue from the VObjectKey union because it wasn't used and made it too difficult to prove safety.
Fixes build failures and CI failures such as these: https://github.com/snazzy-d/sdc/actions/runs/3970459790/jobs/6806208714