core: Add core::ffi::c_intptr_t and core::ffi::c_uintptr_t#156626
core: Add core::ffi::c_intptr_t and core::ffi::c_uintptr_t#156626lygstate wants to merge 1 commit into
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This is a complement to c_ptrdiff_t Tracking issue: rust-lang#88345 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
|
There are some unresolved questions there that unfortunately haven't made much progress. I'm not sure it's worth adding more types without having a better story there. |
libc is looking for release 1.0 I think it's time to resolve those questions. What's the questions comes from, can you give me the link. |
As far as libc 1.0 is concerned, the only thing I'd like is for the lang team to say that Info is scattered, see discussion around #88345 (comment) https://internals.rust-lang.org/t/pre-rfc-usize-semantics/19444/22, https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Compat.20with.20size_t.2C.20ptrdiff_t.2C.20intptr_t.2C.20fnptr-sized.20int/with/547982505, and a few other places on Zulip. |
| /// requires that this type be a signed integer type just capable of holding a | ||
| /// pointer. | ||
| #[unstable(feature = "c_size_t", issue = "88345")] | ||
| pub type c_intptr_t = isize; |
There was a problem hiding this comment.
Thanks for adding this type it is IMO essential. On platforms such as CHERI for RISCV (RVY), we can change this typedef to be apointer type instead.
|
CC: @xdoardo |
|
For anybody who has opinions here about CHERI or otherwise, it would be good to hop in to the ongoing discussion at #t-lang > Compat with size_t, ptrdiff_t, intptr_t, fnptr-sized int. |
This is a complement to c_ptrdiff_t
Tracking issue: #88345