Skip to content

Conversation

@adamdruppe
Copy link
Contributor

I forked @edi33416 's PR here #10265 and split it into two pieces as mentioned in the comments.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @adamdruppe! 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

Auto-close Bugzilla Severity Description
20318 normal Illegal instruction (core dumped)

Testing this PR locally

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

dub fetch digger
dub run digger -- build "master + dmd#10528"

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

The two traits can be written together with a small change

src/dmd/traits.d Outdated
}
return True();
}
if (e.ident == Id.hasPostblit)
Copy link

Choose a reason for hiding this comment

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

The two traits share most of their code. So here

if (e.ident == Id.hasPostblit || e.ident == Id.hasCopyConstructor)

src/dmd/traits.d Outdated
Type tb = t.baseElemOf();
if (auto sd = tb.ty == Tstruct ? (cast(TypeStruct)tb).sym : null)
{
return sd.postblit ? True() : False();
Copy link

Choose a reason for hiding this comment

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

and then here

 return (e.ident == Id.hasPostblit) ? (sd.postblit ? True() : False())
                                    : (sd.hasCopyCtor ? True() : False());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i originally literally just mindlessly copy/pasted it but this is nicer, change made just waiting on the autotester to make sure i didnt mess up

@WalterBright WalterBright merged commit 2bbd37b into dlang:master Nov 1, 2019
@wilzbach
Copy link
Contributor

wilzbach commented Nov 1, 2019

Please don't forget the dlang.org update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants