Turn .ptr deprecation into an error#7688
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. |
|
LGTM |
|
finger hovers on merge button |
|
Why is this labeled "WIP"? |
|
I assume because @wilzbach can't test locally, so using ci to tell him/us what breaks with this change. I'll block on missing changelog anyhow. |
|
Curious that this didn't require a change to any test cases, yet coverage shows it's covered. 🤔 |
|
The tests are likely fail_compilation with |
fee7832 to
2f05e0a
Compare
Yeah, I often patch the test suite, but sometimes I'm in a hurry.
Found the test.
Added. |
2f05e0a to
71c0a91
Compare
|
|
71c0a91 to
8502689
Compare
I didn't judge it as important enough, because it's more or less obvious, but that you are wondering about it, is reason enough to include it (I just did so). |
test/fail_compilation/test11176.d
Outdated
| REQUIRED_ARGS: | ||
| --- | ||
| fail_compilation/test11176.d(12): Deprecation: b.ptr cannot be used in @safe code, use &b[0] instead | ||
| fail_compilation/test11176.d(16): Deprecation: b.ptr cannot be used in @safe code, use &b[0] instead |
There was a problem hiding this comment.
This isn't making any sense to me. Why are the tests passing? The output of this test should be
Error: `b.ptr` cannot be used in `@safe` code, use `&b[0]` instead
There was a problem hiding this comment.
There is no TEST_OUTPUT in the comment, and so the output is not tested.
There was a problem hiding this comment.
Excellent catch - the test helped me to realize that there was another Deprecation message that needed maintenance (i.e. the one for dynamic arrays).
8502689 to
4e5c53f
Compare
|
I'm going to say all good to go. @JinShil ? |
src/dmd/mtype.d
Outdated
| e.deprecation("`%s.ptr` cannot be used in `@safe` code, use `&%s[0]` instead", e.toChars(), e.toChars()); | ||
| // return new ErrorExp(); | ||
| e.error("`%s.ptr` cannot be used in `@safe` code, use `&%s[0]` instead", e.toChars(), e.toChars()); | ||
| return new ErrorExp(); |
JinShil
left a comment
There was a problem hiding this comment.
Just waiting on whitespace fix. I really need to figure out how to do such changes as part of reviewing/merging.
|
Fixed whitespace with |
This was scheduled to happen in 2.073 - we really need a file or wiki to list
these things, s.t. they aren't forgotten.
I'm abusing auto-tester for testing as due to
-fPICI stillcan't run the testsuite locally.