Skip to content

Don't suggest using fields in a static method #33613

Closed
@Ms2ger

Description

@Ms2ger
fn f(_: bool) {}

struct Foo {
    cx: bool,
}

impl Foo {
    fn bar() {
        f(cx);
    }
}

fn main() {}
<anon>:9:11: 9:13 error: unresolved name `cx`. Did you mean `self.cx`? [E0425]
<anon>:9         f(cx);
                   ^~

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions