-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tracking issue for core::ptr::dangling/_mut
(feature ptr_dangling
)
#45557
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
Comments
One issue I can see with this function is that it might return pointers that actually point somewhere even on systems where the 0th page is considered to be always unmapped. |
As I understand it the point of the function is to return something non-null and aligned, so it doesn't matter whether it's a valid pointer or not. |
That seems fine. I was concerned because IIRC the PR specifically said
something about them being valid and the documentation for the function
also said something similar.
…On Oct 30, 2017 11:13 PM, "Vadim Petrochenkov" ***@***.***> wrote:
As I understand it the point of the function is to return something
non-null and aligned, so it doesn't matter whether it's a valid pointer or
not.
We can just specify that you are not allowed to dereference the pointer
returned by ptr::dangling without guaranteeing anything about it validity
(i.e. equality to other existing valid pointers).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#45557 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApc0se4c7fVhlH3da-gXfTz85UsMLrvks5sxjv4gaJpZM4QIJlZ>
.
|
Ah the mornings.
The PR description had a proposal to name the function invalid_... And the
description specifically claims it will not point to any object.
I'd like the documentation changed so it doesn't attempt to guarantee the
function will always return an address that's not pointing to a valid
object.
…On Oct 31, 2017 7:53 AM, "Simonas Kazlauskas" ***@***.***> wrote:
That seems fine. I was concerned because IIRC the PR specifically said
something about them being valid and the documentation for the function
also said something similar.
On Oct 30, 2017 11:13 PM, "Vadim Petrochenkov" ***@***.***>
wrote:
> As I understand it the point of the function is to return something
> non-null and aligned, so it doesn't matter whether it's a valid pointer or
> not.
> We can just specify that you are not allowed to dereference the pointer
> returned by ptr::dangling without guaranteeing anything about it
> validity (i.e. equality to other existing valid pointers).
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#45557 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AApc0se4c7fVhlH3da-gXfTz85UsMLrvks5sxjv4gaJpZM4QIJlZ>
> .
>
|
If you want changes in the PR #45527, please write about them over there. |
This feature never landed and the implementation PR is closed. Closing this as well, feel free to reopen as appropriate. |
Tracking issue for
core::ptr::dangling/_mut
(featureptr_dangling
)The text was updated successfully, but these errors were encountered: