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

gccrs: add diagnostic for E0229 no associated type arguments allowed here #3431

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

philberty
Copy link
Member

gccrs: add diagnostic for E0229 no associated type arguments allowed here

It seems bounds in qualified paths are not allowed to specify associated
type bindings because its going to be associated with the impl block
anyway.

Fixes Rust-GCC#2369

gcc/rust/ChangeLog:

        * typecheck/rust-hir-type-check-base.h: add flag
        * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
        * typecheck/rust-tyty-bounds.cc: new diagnostic

gcc/testsuite/ChangeLog:

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

Signed-off-by: Philip Herron <[email protected]>

@philberty philberty added bug diagnostic diagnostic static analysis labels Feb 12, 2025
@philberty philberty added this to the Remaining typecheck issues milestone Feb 12, 2025
@philberty philberty changed the title Phil/type path ice gccrs: add diagnostic for E0229 no associated type arguments allowed here Feb 12, 2025
@philberty philberty linked an issue Feb 12, 2025 that may be closed by this pull request
We resolve path segments and inserted their resolution into the name
resolution space which was an old hack to use this as information in
code-gen/check-passes in order to help things move forward but this is
not nessecary

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): remove name resolution info
	(TypeCheckType::resolve_root_path): likewise
	* typecheck/rust-hir-type-check-type.h: likewise

Signed-off-by: Philip Herron <[email protected]>
…here

It seems bounds in qualified paths are not allowed to specify associated
type bindings because its going to be associated with the impl block
anyway.

Fixes #2369

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-base.h: add flag
	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise
	* typecheck/rust-tyty-bounds.cc: new diagnostic

gcc/testsuite/ChangeLog:

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

Signed-off-by: Philip Herron <[email protected]>
@philberty philberty added this pull request to the merge queue Feb 12, 2025
Merged via the queue into master with commit c005754 Feb 12, 2025
12 checks passed
@philberty philberty deleted the phil/type-path-ice branch February 13, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug diagnostic diagnostic static analysis
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Associated Type Binding - Internal Compile Error
1 participant