Annotate pure functions with return/scope#3480
Conversation
Awesome!
I think that boils down to
For internal functions like |
RazvanN7
left a comment
There was a problem hiding this comment.
Looks good to me. Why is this still a draft?
|
The remaining errors are with This could be merged in the meanwhile, with a follow up PR for |
| } | ||
|
|
||
| /// Ditto | ||
| TailShared!T atomicLoad(MemoryOrder ms = MemoryOrder.seq, T)(ref shared const T val) pure nothrow @nogc @trusted |
There was a problem hiding this comment.
Wait a second, this is not right. ref should not be removed.
There was a problem hiding this comment.
I remember ref return not compiling, I think it should be ref return scope. I removed this change, will look at it later today (or in a follow-up PR).
|
Thanks for your pull request and interest in making D better, @dkorpel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#3480" |
This PR is similar to dlang/phobos#8076, but for druntime and for dlang/dmd#12010 instead of dlang/dmd#10924
It's probably too big to merge in one go, this is a proof of concept that can later be split up into smaller chunks for easier review.
The offending functions were found with something I cobbled together in dmd: dkorpel/dmd@7d1f0c5
It outputs this when running druntime unittests:
One of the harder ones is:
It's really tricky, since it carefully uses
@trustedblocks to nudge the@safeinference in the right direction, which now breaks. Maybe someone can help out with that.