-
-
Notifications
You must be signed in to change notification settings - Fork 668
Advance deprecation of class allocators and deallocators: Removal #9786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| compilable/vgc1.d(30): vgc: `new` causes a GC allocation | ||
| compilable/vgc1.d(31): vgc: `new` causes a GC allocation | ||
| compilable/vgc1.d(32): vgc: `new` causes a GC allocation | ||
| compilable/vgc1.d(34): vgc: `new` causes a GC allocation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of changing line numbers again, can we use a #line directive for future-proofing ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the test output is fully automated, so this is less work (:
|
Well actually... Can you move the error to the parsing phase ? It would trigger in |
|
Thanks for your pull request and interest in making D better, @JinShil! 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 fetch digger
dub run digger -- build "master + dmd#9786" |
We still need to allow for
Given that, is it still possible to emit an error in the parsing phase? |
Do you have a link to some usages ? Wondering if we can replace this by something else.
Sorry, I'm not sure I follow ? |
https://github.com/Basile-z/iz/blob/7a6b298e161e4d6f8f98fe5fd994e32add70bb18/import/iz/memory.d#L280
This PR is just advancing the deprecation of class deallocators... class C
{
delete(void* p) { } // <-- This will now cause the compiler to emit an error.
}
C c = new C();
delete c; // <-- We still need to support this.I'm looking into how the parser works now, but we'll still need to be able to parse |
|
@CyberShadow Please see the buildkite output. Can we persuade you to update your code? |
Create an issue or PR in the failing project. |
|
I removed the class allocator/deallocator from ae (it was already deprecated), and pushed a new tag. |
See also e.g. https://github.com/dlang/phobos/pull/6003/files |
And Andrei's rebutal includes "this lacks good use cases" |
|
*cough**grumble* see bottom of https://github.com/thewilsonator/Dlang-AGM/blob/master/2019/General.md *cough**grumble* |
I wholeheartedly agree with that, but it's a battle I just can't afford to fight. I'm having a hard enough time getting even more obvious things past the gatekeepers. The easiest way forward for me was to add a special case to allow it and move forward with deprecating everything else. This highlights why moving forward with deprecations is important, because otherwise, users find creative uses for these deprecated features, and then due to our aversion to code breakage, we get stuck with supporting it. But this kind of work is just too unimportant to @WalterBright and @andralex so it doesn't get done for years, and by then we're forced to make such concessions. Not addressing the little stuff has consequences. |
It appears that removing
deleteis going to be quite difficult. In the meantime, we can at least move forward on class allocators and deallocators.Spec update: dlang/dlang.org#2640