-
Notifications
You must be signed in to change notification settings - Fork 179
Fix narrowing conversion warnings #3732
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
Conversation
Open to suggestions on how to make this a bit less ugly, but we should probably fix this bug before GCC 15 releases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the best way to go about this. In some places the ID stored was size - 1
, which is different here. I think we can also find a cleaner way to do this, like maybe storing size_t
instead of uint32_t
in all of those *Id
structs? It used to be an issue when they were type aliases but that's no longer the case
The |
What was an issue with type aliases? Some 32-bit compatibility issue, where |
Fixes PR#119641 gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h (IndexVec::size_type): Add. (IndexVec::MAX_INDEX): Add. (IndexVec::size): Change the return type to the type of the internal value used by the index type. (PlaceDB::lookup_or_add_variable): Use the return value from the PlaceDB::add_place call. * checks/errors/borrowck/rust-bir.h (struct BasicBlockId): Move this definition before the definition of the struct Function. Signed-off-by: Owen Avery <[email protected]>
I think I've found a better way to do this, by modifying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooooh I really like that, well done!! I think this would be really good
Fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119641