Skip to content

Conversation

dkm
Copy link
Member

@dkm dkm commented Jul 8, 2025

Fix narrowing:

  -../../gcc/rust/checks/errors/borrowck/rust-borrow-checker-diagnostics.cc:145:46:
  warning: narrowing conversion of ‘loan’ from ‘Rust::Polonius::Loan’ {aka
  ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} [-Wnarrowing]

@dkm dkm self-assigned this Jul 8, 2025
@dkm dkm force-pushed the dkm/fix_narrowing_error branch 3 times, most recently from 6387a1d to e9dd6f5 Compare July 8, 2025 21:51
dkm added 2 commits July 9, 2025 08:14
Fix narrowing:

  -../../gcc/rust/checks/errors/borrowck/rust-borrow-checker-diagnostics.cc:145:46:
  warning: narrowing conversion of ‘loan’ from ‘Rust::Polonius::Loan’ {aka
  ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} [-Wnarrowing]

gcc/rust/ChangeLog:
	* checks/errors/borrowck/rust-bir-place.h (LoanId::value): Make
	it size_t to match Loan's base type.

Signed-off-by: Marc Poulhiès <[email protected]>
After previous change, removed the last warning from the
expected file.

ChangeLog:

	* .github/glibcxx_ubuntu64b_log_expected_warnings: Remove warning.
	* .github/log_expected_warnings: Likewise.

Signed-off-by: Marc Poulhiès <[email protected]>
@dkm dkm force-pushed the dkm/fix_narrowing_error branch from e9dd6f5 to 0bd440e Compare July 9, 2025 06:14
@dkm dkm requested review from CohenArthur and powerboat9 July 9, 2025 07:59
@dkm
Copy link
Member Author

dkm commented Jul 9, 2025

I don't understand why the warning is not present in the #3860 branch, but I think it makes sense to have both types be the same size.

@dkm dkm added the cleanup label Jul 9, 2025
@dkm dkm mentioned this pull request Jul 9, 2025
Copy link
Collaborator

@powerboat9 powerboat9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@philberty philberty added this pull request to the merge queue Jul 10, 2025
Merged via the queue into master with commit 390e6e4 Jul 10, 2025
13 checks passed
@dkm dkm deleted the dkm/fix_narrowing_error branch July 10, 2025 09:46
@tschwinge
Copy link
Member

Hmm, shouldn't this instead have merged the GCC upstream commit 1e69c56 "rust: Silence a clang warning in borrow-checker-diagnostics"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants