Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better subset errors #3113

Merged
merged 2 commits into from
Aug 16, 2024
Merged

Better subset errors #3113

merged 2 commits into from
Aug 16, 2024

Conversation

braw-lee
Copy link
Contributor

@braw-lee braw-lee commented Aug 2, 2024

depends on #3088

@braw-lee braw-lee force-pushed the better_subset_errors branch from 1c28f7e to 45e185f Compare August 5, 2024 06:03
@P-E-P
Copy link
Member

P-E-P commented Aug 7, 2024

Oh I didn't see this was still in draft, don't mind me, I'll come back later 😆

Mapped placeholder regions to their respective HIR nodes so we can fetch
locations during error reporting.

gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-bir-builder.h: Map regions to
	their respective HIR nodes.
	* checks/errors/borrowck/rust-bir.h (struct Function):
	Add unordered_map to maintain the mapping.

Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
gcc/rust/ChangeLog:

	* checks/errors/borrowck/rust-borrow-checker-diagnostics.cc
	(BorrowCheckerDiagnostics::report_subset_errors): Highlight
	lifetime locations while reporting subset errors.
	(BorrowCheckerDiagnostics::get_lifetime_param): Helper function
	to fetch HIR::Lifetime node from Polonius::Origin.
	* checks/errors/borrowck/rust-borrow-checker-diagnostics.h:
	Definition of helper function.

gcc/testsuite/ChangeLog:

	* rust/borrowck/subset.rs: Better subset errors.

Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
@braw-lee braw-lee force-pushed the better_subset_errors branch from 45e185f to 29ccc8a Compare August 16, 2024 10:45
@braw-lee braw-lee marked this pull request as ready for review August 16, 2024 10:45
@P-E-P P-E-P added this pull request to the merge queue Aug 16, 2024
Merged via the queue into Rust-GCC:master with commit c6d0824 Aug 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants