-
-
Notifications
You must be signed in to change notification settings - Fork 747
Push deprecation of std.exception.enforceEx #6286
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
|
Thanks for your pull request, @wilzbach! 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. |
|
What does |
|
|
||
| --- | ||
| import std.exception : errnoEnforce; | ||
| errnoEnforce(enforce(errno != EINVAL, "Invalid environment variable name: '" ~ name ~ "'"); |
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.
Not sure what you meant here but this is not valid code.
|
|
||
| --- | ||
| import std.exception : enforce; | ||
| enforce(enforce(errno != EINVAL, "Invalid environment variable name: '" ~ name ~ "'"); |
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.
Ditto
std/mmfile.d
Outdated
| // Adjust size | ||
| stat_t statbuf = void; | ||
| errnoEnforce(fstat(fd, &statbuf) == 0); | ||
| enforce(fstat(fd, &statbuf) == 0); |
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.
All of these changes are bogus.
errnoEnforce is useful in that it catches errno and prints a useful error message depending on its value.
Well We could deprecate |
std/exception.d
Outdated
| -------------------- | ||
| +/ | ||
| //deprecated("Please use enforce instead") | ||
| deprecated("Use `enforce`. `enforceEx` will be removed with 2.084.") |
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.
this should be 2.089 if we follow dlang/DIPs#108
Urgh that's very long, but it will be even longer if this doesn't get merged, so I changed the version ... |
|
The deprecation has already been approved in #6086 |
In #6086 we prepared
enforceto be a super set ofenforceExand thus allow a deprecation of it.See also: https://dlang.org/changelog/2.079.0.html#std-exception-enforce
This has happened, so we finally can start the deprecation rodeo.
The targetted deprecation version is 2.084 as it's marked as a legacy symbol in the docs for quite a while now.