-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
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. |
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.
Changelog entry
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
@@ -1,5 +1,5 @@ | |||
/* | |||
REQUIRED_ARGS: -de | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no TEST_OUTPUT
in the comment, and so the output is not tested.
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.
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(); |
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.
Funny whitespace
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.
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
-fPIC
I stillcan't run the testsuite locally.