Skip to content

Commit

Permalink
borrowck: Fix debug prints on 32-bits architectures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CohenArthur authored and P-E-P committed Aug 6, 2024
1 parent d2f032f commit bccb35b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gcc/rust/checks/errors/borrowck/rust-bir-builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ class Builder final : public AbstractBuilder
ctx.fn_free_regions[bound.second.get_index ()]);

auto last_bound = universal_region_bounds.back ();
rust_debug ("\t\t %ld: %ld", last_bound.first, last_bound.second);
rust_debug ("\t\t %lu: %lu", (unsigned long) last_bound.first,
(unsigned long) last_bound.second);
}

// TODO: handle type_region constraints
Expand Down
6 changes: 4 additions & 2 deletions gcc/rust/checks/errors/borrowck/rust-bir-fact-collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,16 @@ class FactCollector : public Visitor
protected: // Subset helpers.
void push_subset (FreeRegion lhs, FreeRegion rhs)
{
rust_debug ("\t\tpush_subset: '?%lu: '?%lu", lhs, rhs);
rust_debug ("\t\tpush_subset: '?%lu: '?%lu", (unsigned long) lhs,
(unsigned long) rhs);

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

void push_subset_all (FreeRegion lhs, FreeRegion rhs)
{
rust_debug ("\t\tpush_subset_all: '?%lu: '?%lu", lhs, rhs);
rust_debug ("\t\tpush_subset_all: '?%lu: '?%lu", (unsigned long) lhs,
(unsigned long) rhs);

for (auto point : cfg_points_all)
facts.subset_base.emplace_back (lhs, rhs, point);
Expand Down

0 comments on commit bccb35b

Please sign in to comment.