Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Rework _d_arrayappendT to be a template function#3805

Merged
RazvanN7 merged 2 commits intodlang:masterfrom
teodutu:rework-_d_arrayappendT
Apr 22, 2022
Merged

Rework _d_arrayappendT to be a template function#3805
RazvanN7 merged 2 commits intodlang:masterfrom
teodutu:rework-_d_arrayappendT

Conversation

@teodutu
Copy link
Member

@teodutu teodutu commented Apr 21, 2022

The previous hook was wrapped in a template to easily define _d_arrayappendTTrace as an alias to _d_HookTraceImpl. That implementation forced _d_arrayappendT to be declared @trusted pure to make it callable from pure contexts. This is problematic when the hook calls copyEmplace on a type whose postblit is impure. In this case, copyEmplace is impure, which creates a conflict with _d_arrayappendT's forced purity.

This PR removes the aforementioned template and leaves it up to the compiler to infer the purity of _d_arrayappendT. This change is required for the new lowering of CatAssignExp: dlang/dmd#13495.

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
@dlang-bot
Copy link
Contributor

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 verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

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 references

Your 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 locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3805"

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
@RazvanN7 RazvanN7 merged commit 06be5bc into dlang:master Apr 22, 2022
@teodutu teodutu deleted the rework-_d_arrayappendT branch April 22, 2022 07:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants