Fix narrowing conversion warnings#3732
Conversation
|
Open to suggestions on how to make this a bit less ugly, but we should probably fix this bug before GCC 15 releases |
CohenArthur
left a comment
There was a problem hiding this comment.
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 <powerboat9.gamer@gmail.com>
|
I think I've found a better way to do this, by modifying |
CohenArthur
left a comment
There was a problem hiding this comment.
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