Repository navigation
Bare type in impl parameter list causes non-intuitive parse error #147889
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Activity
- addedA-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Oct 19, 2025 @rustbot claim
I think the desired output given is mostly OK
The second hint should suggestInst: TkCanvasinstead IMO, but that can be changed later on :)Should this be extended to functions where such a mistake might happen too?
Playgroundfn meow<Box<String>>() {}
Reacted by Esteban KuberSorry; I haven't found the time to work on Rust due to life. Releasing.
@rustbot release-assignmentReacted by Esteban Kuber@rustbot claim
- added 2 commits that reference this issue
on Jul 6, 2026 - added a commit that references this issue
on Jul 6, 2026
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=0f2e1d057720a06ecd77956f5b411416
Found in the wild at https://users.rust-lang.org/t/help-me-understand-this-compiler-error/134753
Other cases
Rust Version
Anything else?
No response