Skip to content

Add Isize and Usize IntKinds for use in ParseCallbacks::int_macro#3366

Open
TheJokr wants to merge 1 commit intorust-lang:mainfrom
TheJokr:intkind-iusize
Open

Add Isize and Usize IntKinds for use in ParseCallbacks::int_macro#3366
TheJokr wants to merge 1 commit intorust-lang:mainfrom
TheJokr:intkind-iusize

Conversation

@TheJokr
Copy link
Copy Markdown

@TheJokr TheJokr commented Apr 28, 2026

C macros are often used to define array/buffer size constants. In Rust, representing these as usize is more natural than the fixed-bit-size integer types, because it allows indexing and comparisons without casting.

I also added isize while I was at it. Using these types is already possible via IntKind::Custom, but given they are built-in integer types like u64 and i64, I figured having a separate enum variant would be appropriate.

C macros are often used to define array/buffer size constants. In Rust,
representing these as `usize` is more natural than the fixed-bit-size
integer types, because it allows indexing and comparisons without
casting.

I also added `isize` while I was at it. Using these types is already
possible via `IntKind::Custom`, but given they are built-in integer
types like `u64` and `i64`, I figured having a separate enum variant
would be appropriate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant