Skip to content

Erroneous self arguments on bare functions emit subpar compilation error #55972

Closed
@nox

Description

@nox

When refactoring methods as bare functions and forgetting to remove the self argument, the compiler fails to parse the new function entirely instead of emitting a better error.

error: expected one of `::` or `:`, found `,`
    --> components/canvas_traits/webgl.rs:1000:10
     |
1000 |     &self,
     |          ^ expected one of `::` or `:` here

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions