Skip to content

Conversation

philberty
Copy link
Member

self params dont have a type unless used within impl blocks. Rustc as far as I can tell in this senario generics a synthetic param of type Self in this senario so that it keeps consistent error diagnostic for number of parameters but the logic for what the parameter typpe should be seems unclear.

Fixes #3592

gcc/rust/ChangeLog:

* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): add error diagnostic

gcc/testsuite/ChangeLog:

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

self params dont have a type unless used within impl blocks. Rustc as far as I
can tell in this senario generics a synthetic param of type Self in this senario
so that it keeps consistent error diagnostic for number of parameters but the
logic for what the parameter typpe should be seems unclear.

Fixes #3592

gcc/rust/ChangeLog:

	* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): add error diagnostic

gcc/testsuite/ChangeLog:

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

Signed-off-by: Philip Herron <[email protected]>
@philberty philberty added the bug label Sep 22, 2025
@philberty philberty added this pull request to the merge queue Sep 22, 2025
Merged via the queue into master with commit 5a762b9 Sep 22, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in libcore 1.49 Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ICE in get_type, at rust/ast/rust-item.h:533

1 participant