Push deprecation of std.exception.enforceEx#6286
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.
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 ~ "'"); |
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.
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.
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.