Skip to content

Commit 6a05b0a

Browse files
CohenArthurP-E-P
authored andcommitted
borrowck: Avoid overloading issues on 32bit architectures
On architectures where `size_t` is `unsigned int`, such as 32bit x86, we encounter an issue with `PlaceId` and `FreeRegion` being aliases to the same types. This poses an issue for overloading functions for these two types, such as `push_subset` in that case. This commit renames one of these `push_subset` functions to avoid the issue, but this should be fixed with a newtype pattern for these two types. gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-fact-collector.h (points): Rename `push_subset(PlaceId, PlaceId)` to `push_subset_place(PlaceId, PlaceId)`
1 parent bccb35b commit 6a05b0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class FactCollector : public Visitor
334334
expr.get_rhs () - 1, current_bb, current_stmt);
335335

336336
issue_read_move (expr.get_rhs ());
337-
push_subset (lhs, expr.get_rhs ());
337+
push_place_subset (lhs, expr.get_rhs ());
338338
}
339339

340340
void visit (const CallExpr &expr) override
@@ -662,7 +662,7 @@ class FactCollector : public Visitor
662662
}
663663
}
664664

665-
void push_subset (PlaceId lhs, PlaceId rhs)
665+
void push_place_subset (PlaceId lhs, PlaceId rhs)
666666
{
667667
auto &lhs_place = place_db[lhs];
668668
auto &rhs_place = place_db[rhs];

0 commit comments

Comments
 (0)