-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Document that null is 0 #116895
Comments
there was some discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Null.20vs.200 |
Int-to-ptr casts are terrible, I'd rather not do that. In fact these two are not equivalent for Miri (but that might be a Miri limitation, int2ptr is just hard or impossible to handle precisely for a tool like Miri). We should say that it returns a pointer whose address is 0, but we shouldn't commit to which provenance it has. |
#116988 adds the docs for this. |
document that the null pointer has the 0 address Fixes rust-lang/rust#116895 Will need t-lang FCP, but I think this is fairly uncontroversial -- there's probably already tons of code out there that relies on this.
document that the null pointer has the 0 address Fixes rust-lang/rust#116895 Will need t-lang FCP, but I think this is fairly uncontroversial -- there's probably already tons of code out there that relies on this.
document that the null pointer has the 0 address Fixes rust-lang/rust#116895 Will need t-lang FCP, but I think this is fairly uncontroversial -- there's probably already tons of code out there that relies on this.
This has come up in two places recently: #115333 (comment) and #116675 (comment).
We should do the following:
ptr::null()
, document thatptr::null()
is equivalent to0usize as *const _
Are there other places we should update too?
cc @the8472 @tmandry @RalfJung
The text was updated successfully, but these errors were encountered: