Skip to content

Improve error message when trying to use unsafe self #8306

Closed
@dovreshef

Description

@dovreshef

The error does not make it clear.

struct S;

impl S {
    fn foo(*mut self) { }
}

error: unexpected token: `*`
     fn foo(*mut self) {
            ^

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-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions