Skip to content

Inline hasElaborateDestructor!(...) into __(needsDestruction, ...)#22853

Merged
thewilsonator merged 1 commit intodlang:masterfrom
nordlow:use-builtin-trait-needsDestruction
Apr 5, 2026
Merged

Inline hasElaborateDestructor!(...) into __(needsDestruction, ...)#22853
thewilsonator merged 1 commit intodlang:masterfrom
nordlow:use-builtin-trait-needsDestruction

Conversation

@nordlow
Copy link
Copy Markdown
Contributor

@nordlow nordlow commented Apr 1, 2026

For the sake of avoiding template bloat as evaluation of a built trait is magnitudes faster than instantiating any template.

As mentioned in TODO at https://github.com/dlang/dmd/pull/22853/changes#diff-9cf671c1375bf050cf93c1ed0b4b81b30d5ba8822b10b9ef3435fc8f67e85553L289.

@dlang-bot
Copy link
Copy Markdown
Contributor

Thanks for your pull request and interest in making D better, @nordlow! 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 + dmd#22853"

Copy link
Copy Markdown
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise looks good.

@nordlow nordlow force-pushed the use-builtin-trait-needsDestruction branch from 2be52af to 93cfd18 Compare April 4, 2026 19:40

// Used by std.traits.hasElaborateDestructor
// TODO inline this in druntime
// TODO deprecate
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is internal, we can probably just remove it, but that can be dome later.

@thewilsonator thewilsonator merged commit 0d11061 into dlang:master Apr 5, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants