Skip to content

typecheck: Fix location and add help for E0044 foreign generics#4374

Open
Pasta-coder wants to merge 1 commit intoRust-GCC:masterfrom
Pasta-coder:issue-3526
Open

typecheck: Fix location and add help for E0044 foreign generics#4374
Pasta-coder wants to merge 1 commit intoRust-GCC:masterfrom
Pasta-coder:issue-3526

Conversation

@Pasta-coder
Copy link
Contributor

@Pasta-coder Pasta-coder commented Jan 10, 2026

Related to #3526

@Pasta-coder Pasta-coder force-pushed the issue-3526 branch 2 times, most recently from b1b7baa to b6d298a Compare January 10, 2026 17:07
@Pasta-coder
Copy link
Contributor Author

while looking at the refactored code i came across that the primary reason the error was misleading was that the TypeCheck pass was explicitly reading the location of the ExternalFunctionItem (the fn keyword) instead of the GenericParam (the <T>).

the lexer issue still exists .

this doesn't not resolve issue #3526 .

@Pasta-coder Pasta-coder marked this pull request as draft January 29, 2026 06:09
@Pasta-coder Pasta-coder force-pushed the issue-3526 branch 5 times, most recently from 01f77a6 to 5d33505 Compare February 1, 2026 15:02
@Pasta-coder Pasta-coder marked this pull request as ready for review February 1, 2026 18:54
@Pasta-coder
Copy link
Contributor Author

@philberty what do you think about these changes ?

thankyou .

@Pasta-coder Pasta-coder marked this pull request as draft February 3, 2026 14:23
This patch improves the diagnostic for E0044 (foreign items with generics).
Previously, the help message was missing, and the error location needed
verification.

Fixes Rust-GCC#3526

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_generic_params):
	Add rust_inform help message and ensure correct locus for E0044.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-3526.rs: New test.

Signed-off-by: Jayant Chauhan <0001jayant@gmail.com>
@Pasta-coder Pasta-coder marked this pull request as ready for review February 4, 2026 16:01
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.

2 participants