Conversation
The previous implementation used `enforceRawArraysConformable`, which prevented it from being called by @nogc functions. Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
|
Thanks for your pull request and interest in making D better, @teodutu! 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#3582" |
| void[] vFrom = (cast(void*)from.ptr)[0..from.length]; | ||
| void[] vTo = (cast(void*)to.ptr)[0..to.length]; | ||
| enforceRawArraysConformable("initialization", element_size, vFrom, vTo, false); | ||
| assert(vFrom.length == vTo.length, "Array lengths don't match"); |
There was a problem hiding this comment.
it's quite unfortunate that we have to use such a bad error message, but at this point I don't really see another alternative.
There was a problem hiding this comment.
I think we could use a similar hack to the one used to make Exceptions @nogc.
The idea behind the hack is to statically allocate on the TLS a predefined _store and use that to hold the Exception object. In our case, we would use the TLS _store to hold the error message.
This PR fixes the
_d_arrayctortemplate, which is to be used by dmd instead of the old hook, as implemented in this PR: dlang/dmd#13116The previous implementation used
enforceRawArraysConformable, which prevented it from being called by @nogc functions. This resulted in some dmd unittests failing in the PR above.