You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On ptr::null(), document that ptr::null() is equivalent to 0usize as *const _
Either before or after it lands, update the text in #116675 to document that "allocated objects" cannot contain the 0 address (alternatively, if that PR lands with text that says that an allocated object cannot contain the "null" address, update the text to mention that null is equal to 0)
document that ptr::null() is equivalent to 0usize as *const _
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.
Activity
Noratrieb commentedon Oct 19, 2023
there was some discussion in https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Null.20vs.200
RalfJung commentedon Oct 20, 2023
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.
RalfJung commentedon Oct 20, 2023
#116988 adds the docs for this.
Auto merge of rust-lang#116988 - RalfJung:null, r=WaffleLapkin
Auto merge of #116988 - RalfJung:null, r=WaffleLapkin
Auto merge of #116988 - RalfJung:null, r=WaffleLapkin
Auto merge of #116988 - RalfJung:null, r=WaffleLapkin
Auto merge of #116988 - RalfJung:null, r=WaffleLapkin