Skip to content

Commit bccb35b

Browse files
CohenArthurP-E-P
authored andcommitted
borrowck: Fix debug prints on 32-bits architectures
gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder.h: Cast size_t values to unsigned long before printing. * checks/errors/borrowck/rust-bir-fact-collector.h: Likewise.
1 parent d2f032f commit bccb35b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

gcc/rust/checks/errors/borrowck/rust-bir-builder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class Builder final : public AbstractBuilder
9191
ctx.fn_free_regions[bound.second.get_index ()]);
9292

9393
auto last_bound = universal_region_bounds.back ();
94-
rust_debug ("\t\t %ld: %ld", last_bound.first, last_bound.second);
94+
rust_debug ("\t\t %lu: %lu", (unsigned long) last_bound.first,
95+
(unsigned long) last_bound.second);
9596
}
9697

9798
// TODO: handle type_region constraints

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,14 +621,16 @@ class FactCollector : public Visitor
621621
protected: // Subset helpers.
622622
void push_subset (FreeRegion lhs, FreeRegion rhs)
623623
{
624-
rust_debug ("\t\tpush_subset: '?%lu: '?%lu", lhs, rhs);
624+
rust_debug ("\t\tpush_subset: '?%lu: '?%lu", (unsigned long) lhs,
625+
(unsigned long) rhs);
625626

626627
facts.subset_base.emplace_back (lhs, rhs, get_current_point_mid ());
627628
}
628629

629630
void push_subset_all (FreeRegion lhs, FreeRegion rhs)
630631
{
631-
rust_debug ("\t\tpush_subset_all: '?%lu: '?%lu", lhs, rhs);
632+
rust_debug ("\t\tpush_subset_all: '?%lu: '?%lu", (unsigned long) lhs,
633+
(unsigned long) rhs);
632634

633635
for (auto point : cfg_points_all)
634636
facts.subset_base.emplace_back (lhs, rhs, point);

0 commit comments

Comments
 (0)